tf-mcp-server 0.5.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ node_modules/**
2
+ .env
3
+ *.env
4
+ .env.local
5
+ .env.production
6
+ .env.staging
7
+ dist/
8
+ build/
9
+ __pycache__/
10
+ *.pyc
11
+ *.pyo
12
+ *.pyd
13
+ .Python
14
+ env/
15
+ venv/
16
+ .venv/
17
+ pip-log.txt
18
+ pip-delete-this-directory.txt
19
+ .pytest_cache/
20
+ .coverage
21
+ htmlcov/
22
+ .mypy_cache/
23
+ .DS_Store
Dockerfile ADDED
@@ -0,0 +1,34 @@
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install curl for healthcheck
6
+ RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
7
+
8
+ # Install Python dependencies
9
+ RUN pip install --no-cache-dir fastmcp uvicorn pydantic python-frontmatter
10
+
11
+ # Copy documentation sources from repo root
12
+ COPY docs/tf_docs/docs /app/docs/tf_docs/docs
13
+ COPY docs/api_docs/public /app/docs/api_docs/public
14
+
15
+ # Copy server code
16
+ COPY tf_mcp_server /app/tf_mcp_server
17
+
18
+ # Set environment variables
19
+ ENV MCP_HOST=0.0.0.0
20
+ ENV MCP_PORT=8000
21
+ ENV DOCS_PATH=/app/docs/tf_docs/docs
22
+ ENV API_DOCS_PATH=/app/docs/api_docs/public
23
+ ENV BASE_PATH=/app
24
+ ENV PYTHONPATH=/app
25
+
26
+ # Expose port
27
+ EXPOSE 8000
28
+
29
+ # Health check for ECS
30
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
31
+ CMD curl -f http://localhost:8000/health || exit 1
32
+
33
+ # Run the server
34
+ CMD ["python", "-m", "tf_mcp_server.server"]
Dockerfile.full ADDED
@@ -0,0 +1,30 @@
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install curl for healthcheck
6
+ RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
7
+
8
+ # Install Python dependencies
9
+ RUN pip install --no-cache-dir fastmcp uvicorn pydantic python-frontmatter
10
+
11
+ # Copy documentation sources from repo root
12
+ COPY docs/tf_docs/docs /app/docs/tf_docs/docs
13
+ COPY docs/api_docs/public /app/docs/api_docs/public
14
+
15
+ # Copy server code
16
+ COPY tf_mcp_server /app/tf_mcp_server
17
+
18
+ # Set environment variables
19
+ ENV MCP_HOST=0.0.0.0
20
+ ENV MCP_PORT=8000
21
+ ENV DOCS_PATH=/app/docs/tf_docs/docs
22
+ ENV API_DOCS_PATH=/app/docs/api_docs/public
23
+ ENV BASE_PATH=/app
24
+ ENV PYTHONPATH=/app
25
+
26
+ # Expose port
27
+ EXPOSE 8000
28
+
29
+ # Run the server
30
+ CMD ["python", "-m", "tf_mcp_server.server"]
PKG-INFO ADDED
@@ -0,0 +1,356 @@
1
+ Metadata-Version: 2.4
2
+ Name: tf-mcp-server
3
+ Version: 0.5.6
4
+ Summary: MCP server for ToothFairyAI documentation
5
+ Author-email: ToothFairyAI <support@toothfairyai.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: fastmcp>=0.4.0
9
+ Requires-Dist: httpx>=0.27.0
10
+ Requires-Dist: pydantic>=2.0.0
11
+ Requires-Dist: python-frontmatter>=1.0.0
12
+ Requires-Dist: toothfairyai>=0.5.5
13
+ Requires-Dist: uvicorn>=0.30.0
14
+ Provides-Extra: dev
15
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
16
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
17
+ Description-Content-Type: text/markdown
18
+
19
+ # ToothFairyAI Documentation MCP Server
20
+
21
+ A Model Context Protocol (MCP) server that exposes ToothFairyAI documentation, API specifications, and integration guides for AI assistants.
22
+
23
+ ## Features
24
+
25
+ - **Documentation Resources**: Access 47+ markdown documentation pages
26
+ - **API Specifications**: OpenAPI specs for main API, agents API, and voice API (90 endpoints)
27
+ - **Full-Text Search**: Search across all documentation and API endpoints
28
+ - **Dual Transport Support**: Run as HTTP server (remote) or stdio (local)
29
+ - **Health Checks**: Built-in `/health` and `/info` endpoints (HTTP mode)
30
+
31
+ ## Quick Start
32
+
33
+ ### Local Development (HTTP Mode)
34
+
35
+ ```bash
36
+ cd tf_mcp_server
37
+ python -m venv venv
38
+ source venv/bin/activate
39
+ pip install fastmcp uvicorn pydantic python-frontmatter
40
+
41
+ # Run the server (HTTP mode - default)
42
+ python -m tf_mcp_server.server
43
+ ```
44
+
45
+ ### Local Development (stdio Mode)
46
+
47
+ For use with local MCP clients like Claude Code:
48
+
49
+ ```bash
50
+ cd tf_mcp_server
51
+ source venv/bin/activate
52
+
53
+ # Run with stdio transport
54
+ python -m tf_mcp_server.server --stdio
55
+
56
+ # Or set environment variable
57
+ MCP_TRANSPORT=stdio python -m tf_mcp_server.server
58
+ ```
59
+
60
+ ### Docker Deployment
61
+
62
+ ```bash
63
+ # From repository root
64
+ docker build -t tf-mcp-server -f tf_mcp_server/Dockerfile.full .
65
+ docker run -p 8000:8000 tf-mcp-server
66
+ ```
67
+
68
+ ## AWS ECS Deployment (Production)
69
+
70
+ Deployment is automated via GitHub Actions. The workflow triggers on pushes to `development` branch when changes are made to:
71
+ - `tf_mcp_server/**`
72
+ - `docs/tf_docs/docs/**`
73
+ - `docs/api_docs/public/**`
74
+
75
+ ### GitHub Actions Workflow
76
+
77
+ See: [.github/workflows/deployMcpServer-dev.yml](../.github/workflows/deployMcpServer-dev.yml)
78
+
79
+ The workflow:
80
+ 1. Builds Docker image from `tf_mcp_server/Dockerfile`
81
+ 2. Pushes to ECR repository `tf-mcp-server`
82
+ 3. Updates ECS task definition
83
+ 4. Deploys to `tf-dev-cluster`
84
+
85
+ ### AWS Prerequisites
86
+
87
+ Before the workflow can run, create these resources in AWS:
88
+
89
+ 1. **ECR Repository**: `tf-mcp-server`
90
+ 2. **ECS Task Definition**: `tf-mcp-server-dev-service`
91
+ - Container name: `tf-mcp-server-dev-container`
92
+ - Port: 8000
93
+ - Health check: `curl -f http://localhost:8000/health || exit 1`
94
+ 3. **ECS Service**: `tf-mcp-server-dev-service`
95
+ - Cluster: `tf-dev-cluster`
96
+ - Desired count: 1
97
+
98
+ ### Manual Deployment
99
+
100
+ To deploy manually or set up initial infrastructure:
101
+
102
+ ```bash
103
+ cd tf_mcp_server/aws
104
+
105
+ # Set your AWS configuration
106
+ export AWS_REGION=ap-southeast-2
107
+ export VPC_ID=vpc-xxxxxxxxx
108
+ export SUBNET_IDS=subnet-xxx,subnet-yyy
109
+
110
+ # Deploy everything
111
+ ./deploy.sh all
112
+ ```
113
+
114
+ ### Management Commands
115
+
116
+ ```bash
117
+ ./deploy.sh status # Get service status and endpoint URL
118
+ ./deploy.sh logs # View live logs
119
+ ./deploy.sh destroy # Delete all resources
120
+ ```
121
+
122
+ ## Environment Variables
123
+
124
+ | Variable | Default | Description |
125
+ |----------|---------|-------------|
126
+ | `MCP_TRANSPORT` | `http` | Transport type: `stdio` or `http` |
127
+ | `MCP_HOST` | `0.0.0.0` | Host to bind the server (HTTP mode only) |
128
+ | `MCP_PORT` | `8000` | Port to bind the server (HTTP mode only) |
129
+ | `DOCS_PATH` | `docs/tf_docs/docs` | Path to markdown documentation |
130
+ | `API_DOCS_PATH` | `docs/api_docs/public` | Path to API documentation |
131
+ | `BASE_PATH` | (auto-detected) | Base path to repository root |
132
+
133
+ ## HTTP Endpoints
134
+
135
+ | Endpoint | Method | Description |
136
+ |----------|--------|-------------|
137
+ | `/sse` | GET | SSE endpoint for MCP clients (Claude Code) |
138
+ | `/health` | GET | Health check for load balancers |
139
+ | `/info` | GET | Server information and stats |
140
+
141
+ ### Health Check Response
142
+
143
+ ```json
144
+ {
145
+ "status": "healthy",
146
+ "server": "ToothFairyAI Documentation MCP",
147
+ "docs_loaded": 47,
148
+ "api_specs_loaded": 3
149
+ }
150
+ ```
151
+
152
+ ## Connecting MCP Clients
153
+
154
+ ### Claude Code (CLI) Configuration
155
+
156
+ To use the ToothFairyAI MCP server with Claude Code:
157
+
158
+ #### Option 1: Local stdio (Recommended)
159
+
160
+ Run the server locally using stdio transport for the most reliable connection:
161
+
162
+ **CLI Command**
163
+
164
+ ```bash
165
+ claude mcp add toothfairy-docs -- python -m tf_mcp_server.server --stdio
166
+ ```
167
+
168
+ **Manual configuration**
169
+
170
+ Edit your Claude config file (`~/.claude.json`):
171
+
172
+ ```json
173
+ {
174
+ "mcpServers": {
175
+ "toothfairy-docs": {
176
+ "type": "stdio",
177
+ "command": "python",
178
+ "args": ["-m", "tf_mcp_server.server", "--stdio"],
179
+ "cwd": "/path/to/tooth-fairy-website-1/tf_mcp_server"
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
185
+ #### Option 2: Remote SSE
186
+
187
+ Connect to the hosted remote server. Choose the endpoint closest to you:
188
+
189
+ **⚠️ IMPORTANT:** Only AU endpoints are currently available. EU and US endpoints are coming soon.
190
+
191
+ | Environment | Region | Endpoint | Status |
192
+ |-------------|--------|----------|--------|
193
+ | Development | AU | `https://mcp.toothfairylab.link/sse` | ✅ Available |
194
+ | Production | AU | `https://mcp.toothfairyai.com/sse` | ✅ Available |
195
+ | Production | EU | `https://mcp.eu.toothfairyai.com/sse` | ❌ **Not Available** |
196
+ | Production | US | `https://mcp.us.toothfairyai.com/sse` | ❌ **Not Available** |
197
+
198
+ **CLI Command** (example for AU production)
199
+
200
+ ```bash
201
+ claude mcp add toothfairy-docs "https://mcp.toothfairyai.com/sse" -t sse
202
+ ```
203
+
204
+ **Manual configuration**
205
+
206
+ ```json
207
+ {
208
+ "mcpServers": {
209
+ "toothfairy-docs": {
210
+ "type": "sse",
211
+ "url": "https://mcp.toothfairyai.com/sse"
212
+ }
213
+ }
214
+ }
215
+ ```
216
+
217
+ > **Note:** Use `type: "sse"` for remote connections. Replace the URL with your preferred regional endpoint.
218
+
219
+ **Verify the connection**
220
+
221
+ After adding the server, verify it's configured:
222
+
223
+ ```bash
224
+ claude mcp list
225
+ ```
226
+
227
+ Or within Claude Code, type `/mcp` to see connected servers.
228
+
229
+ **Start using the tools**
230
+
231
+ Once connected, Claude Code can automatically use these tools when you ask about ToothFairyAI:
232
+
233
+ | Tool | Example Prompt |
234
+ |------|----------------|
235
+ | `search_docs` | "Search ToothFairyAI docs for how to create an agent" |
236
+ | `search_api_endpoints` | "Find API endpoints related to conversations" |
237
+ | `list_doc_categories` | "What documentation categories are available?" |
238
+ | `get_doc_by_topic` | "Get the documentation about webhooks" |
239
+
240
+ **Example Usage:**
241
+
242
+ ```
243
+ > How do I integrate ToothFairyAI agents into my application?
244
+
245
+ Claude will automatically search the docs and provide relevant information.
246
+ ```
247
+
248
+ ### Claude Desktop Configuration
249
+
250
+ Add to your `claude_desktop_config.json`:
251
+
252
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
253
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
254
+
255
+ #### Option 1: Local stdio (Recommended)
256
+
257
+ ```json
258
+ {
259
+ "mcpServers": {
260
+ "toothfairy-docs": {
261
+ "command": "python",
262
+ "args": ["-m", "tf_mcp_server.server", "--stdio"],
263
+ "cwd": "/path/to/tooth-fairy-website-1/tf_mcp_server"
264
+ }
265
+ }
266
+ }
267
+ ```
268
+
269
+ #### Option 2: Remote SSE
270
+
271
+ Use one of the available endpoints:
272
+ - ✅ AU Production: `https://mcp.toothfairyai.com/sse` (Available)
273
+ - ❌ EU Production: `https://mcp.eu.toothfairyai.com/sse` (Not Available)
274
+ - ❌ US Production: `https://mcp.us.toothfairyai.com/sse` (Not Available)
275
+ - ✅ Development: `https://mcp.toothfairylab.link/sse` (Available)
276
+
277
+ ```json
278
+ {
279
+ "mcpServers": {
280
+ "toothfairy-docs": {
281
+ "url": "https://mcp.toothfairyai.com/sse",
282
+ "transport": "sse"
283
+ }
284
+ }
285
+ }
286
+ ```
287
+
288
+ ### Programmatic Access
289
+
290
+ ```python
291
+ from mcp import ClientSession
292
+ from mcp.client.sse import sse_client
293
+
294
+ # Use available endpoint: mcp.toothfairyai.com (AU - available) or mcp.toothfairylab.link (development)
295
+ # Note: mcp.eu.toothfairyai.com and mcp.us.toothfairyai.com are not available
296
+ async with sse_client(url="https://mcp.toothfairyai.com/sse") as (read, write, _):
297
+ async with ClientSession(read, write) as session:
298
+ await session.initialize()
299
+ tools = await session.list_tools()
300
+ result = await session.call_tool("search_docs", {"query": "agents"})
301
+ ```
302
+
303
+ ## MCP Resources
304
+
305
+ ### Documentation
306
+
307
+ - `toothfairy://docs/list` - List all documentation pages
308
+ - `toothfairy://docs/{category}/{slug}` - Get a specific doc page
309
+
310
+ ### API Specifications
311
+
312
+ - `toothfairy://api/list` - List all API specs
313
+ - `toothfairy://api/{name}` - Get OpenAPI spec (main, agents, voice)
314
+ - `toothfairy://api/{name}/endpoints` - Get endpoints summary
315
+ - `toothfairy://api/integration-guide` - Voice API integration guide
316
+
317
+ ## MCP Tools
318
+
319
+ | Tool | Description |
320
+ |------|-------------|
321
+ | `search_docs(query, limit, source)` | Search all documentation |
322
+ | `search_api_endpoints(query, limit)` | Search API endpoints |
323
+ | `list_doc_categories()` | List documentation categories |
324
+ | `get_doc_by_topic(topic)` | Get doc content by topic |
325
+
326
+ ## MCP Prompts
327
+
328
+ | Prompt | Description |
329
+ |--------|-------------|
330
+ | `api_usage_guide(endpoint)` | Generate guide for an API endpoint |
331
+ | `feature_guide(feature)` | Generate guide for a feature |
332
+
333
+ ## Future: SDK Integration
334
+
335
+ This server is designed to be extended with API tools using the `toothfairyai` Python SDK:
336
+
337
+ ```python
338
+ from toothfairyai import ToothFairyClient
339
+
340
+ @mcp.tool()
341
+ def send_to_agent(agent_id: str, message: str) -> dict:
342
+ client = ToothFairyClient(api_key=..., workspace_id=...)
343
+ response = client.chat.send_to_agent(message, agent_id)
344
+ return {"response": response.agent_response}
345
+ ```
346
+
347
+ ## References
348
+
349
+ - [AWS MCP Servers](https://github.com/awslabs/mcp)
350
+ - [Deploy MCP on Lambda](https://dev.to/aws-builders/deploy-a-minimal-mcp-server-on-aws-lambda-with-serverless-framework-3e42)
351
+ - [Hosting MCP on Lambda for Free](https://dev.to/zhizhiarv/hosting-remote-mcp-server-on-aws-lambda-for-nearly-free-2h8j)
352
+ - [AWS Guidance for MCP](https://aws.amazon.com/solutions/guidance/deploying-model-context-protocol-servers-on-aws/)
353
+
354
+ ## License
355
+
356
+ MIT