Skip to content

feat: add MCP module tests, example app - #87

Merged
tmgbedu merged 4 commits into
mainfrom
feat/mcp-tests-example-docs
Jun 4, 2026
Merged

feat: add MCP module tests, example app#87
tmgbedu merged 4 commits into
mainfrom
feat/mcp-tests-example-docs

Conversation

@tmgbedu

@tmgbedu tmgbedu commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Tests: 111 pytest tests for the MCP module (Server, Tool, Prompt, Resource, Protocol, Response, Argument, JsonRpcRequest) with 100% coverage
  • Example app: example/mcp-app/ — a standalone FastAPI app demonstrating EchoTool, WordCountTool, CodeReviewPrompt, and EnvResource

How to test

```bash
cd fastapi_startkit && uv run pytest tests/mcp/ -v --cov=src/fastapi_startkit/mcp --cov-report=term-missing
```

Closes task #37

🤖 Generated with Claude Code

Implements the Model Context Protocol (MCP) module at
fastapi_startkit/src/fastapi_startkit/mcp/ with Server, Tool, Prompt,
Resource, Response, Argument, JsonRpcRequest, and Protocol classes.
Adds 111 tests at 100% coverage and a dev-tools example app under
example/mcp-app/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tmgbedu
tmgbedu force-pushed the feat/mcp-tests-example-docs branch from eacd0a9 to 06772ec Compare June 4, 2026 22:17
Comment thread example/mcp-app/app.py
@@ -0,0 +1,166 @@
"""Dev-tools MCP server example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claude this looks quite a big file, can you split into smaller files,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Split into a mcp/ submodule:

  • mcp/tools.py — EchoTool, WordCountTool
  • mcp/prompts.py — CodeReviewPrompt
  • mcp/resources.py — EnvResource
  • mcp/server.py — DevToolsServer
  • app.py — bootstrap only (~15 lines)

tmgbedu and others added 3 commits June 4, 2026 15:23
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tmgbedu
tmgbedu merged commit 6ed1ba5 into main Jun 4, 2026
3 checks passed
@tmgbedu
tmgbedu deleted the feat/mcp-tests-example-docs branch June 8, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant