Skip to content

Commit 044eb66

Browse files
add a readme
1 parent 0f636b6 commit 044eb66

File tree

3 files changed

+55
-108
lines changed

3 files changed

+55
-108
lines changed

examples/smack/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Smack - Message Storage Service
2+
3+
Smack is a simple messaging service with a persistent message store using PostgreSQL. It's designed to work with the Model Context Protocol (MCP) Inspector for easy testing and interaction.
4+
5+
## Features
6+
7+
- Persistent message storage using PostgreSQL
8+
- Docker containerization for easy deployment
9+
10+
## Prerequisites
11+
12+
- Docker and Docker Compose
13+
- MCP Inspector (for testing and interaction)
14+
15+
## Quick Start
16+
17+
1. Clone the repository and navigate to the examples/smack directory
18+
19+
2. Start the service using Docker Compose:
20+
```bash
21+
docker compose up
22+
```
23+
This will:
24+
- Build and start the Smack server on port 8000
25+
- Start a PostgreSQL instance on port 5432
26+
- Create necessary volumes for data persistence
27+
28+
There are multiple ways to test the server:
29+
- Using the MCP Inspector (recommended for beginners)
30+
- Using Claude Desktop
31+
- Writing your own MCP client
32+
33+
3. Connect to the service using the MCP Inspector at `localhost:8000`
34+
35+
## Available Tools
36+
37+
### `list_messages()`
38+
Retrieves all posted messages from the database.
39+
40+
**Response Format:**
41+
```
42+
1. sender: message content
43+
2. sender: message content
44+
...
45+
```
46+
47+
### `post_message(message: str)`
48+
Posts a new message to the database.
49+
50+
**Parameters:**
51+
- `message`: The text content you want to post
52+
53+
**Response:**
54+
- Success: "Message posted successfully: '{message}'"
55+
- Failure: Error message if the post failed

examples/smack/db.py

Lines changed: 0 additions & 106 deletions
This file was deleted.

examples/smack/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ services:
55
build: .
66
ports:
77
- "8000:8000"
8-
volumes:
9-
- ./data:/app/data
108
restart: unless-stopped
119
depends_on:
1210
- postgres

0 commit comments

Comments
 (0)