claude-ia-mcp-tools
API-Client → Geschäftslogik → MCP-Tools
Kleines Python-Beispiel, das zeigt, wie man einen API-Client und die Geschäftslogik sowohl aus normalem Anwendungscode als auch aus MCP-Tools wiederverwendet.
Struktur
src/example/
├── api/
│ └── api_client.py
├── business/
│ └── service.py
├── mcp/
│ └── server.py
└── main.pyDas Beispiel stellt 5 Operationen bereit:
get_userlist_userscreate_userupdate_userdelete_user
Die MCP-Ebene ist bewusst dünn gehalten: Sie validiert MCP-Eingaben und delegiert an den Geschäftsdienst. Der Geschäftsdienst delegiert die HTTP-Arbeit an den API-Client.
Related MCP server: JSONPlaceholder MCP Server
Installation
python -m venv .venv
# Windows:
.venv\Scripts\activate
# Linux/macOS:
source .venv/bin/activate
pip install -r requirements.txtMCP-Server ausführen
python -m src.example.mcp.serverOder konfigurieren Sie den MCP-Client so, dass er gestartet wird:
python -m src.example.mcp.serverMCP-Server verwenden
Über Terminal
{"jsonrpc":"2.0","method":"tools/list","id":1}Oder über Claude
{
"mcpServers": {
"example-users": {
"command": "python",
"args": ["-m", "src.example.mcp.server"]
}
}
}Wichtig
Dies ist ein eigenständiges Architekturbeispiel. Der API-Client verwendet
https://jsonplaceholder.typicode.com als öffentliche Demo-API.
Für eine echte API ersetzen Sie die Implementierung von ApiClient und behalten Sie die
Geschäfts- und MCP-Schnittstellen im Wesentlichen unverändert.
Test-Workflow-Ausführung
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Build multi-tenant apps over MCP. Schemas, CRUD, deploys — access control enforced server-side.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceWraps the JSONPlaceholder fake REST API to enable testing and prototyping with CRUD operations on posts, comments, and other resources via MCP.590 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables interaction with the JSONPlaceholder REST API for managing posts, comments, and users through MCP tools.-
- FlicenseNot gradedqualityDmaintenanceA minimal demo MCP server exposing user management tools (list, get, create, update, delete users) over both stdio and HTTP/SSE transports, wrapping an Express REST API to illustrate local vs remote MCP connectivity.-
- AlicenseNot gradedqualityCmaintenanceEnables retrieving user and post data through MCP tools, with Zod-based request validation and OpenAPI/Swagger UI support.MIT