Provides database connectivity for querying data through the query_manse tool, enabling retrieval of records from MariaDB databases with configurable connection parameters.
FastAPI MCP-Style Server
Minimal FastAPI implementation that mimics a subset of Model Context Protocol (MCP) functionality.
Features
- Echo-style POST
/mcp
endpoint returning structured response (id, status, outputs) - JSON-RPC 2.0 endpoint
/mcp/rpc
supporting:mcp.list_tools
mcp.call_tool
(tools:echo
,uppercase
,query_manse
,calc_daewoon
)
- GET usage helper
/mcp
- Pydantic models for request/response
- Basic logging
- Tests (pytest) for REST + RPC
Quick Start
REST Usage
JSON-RPC Examples
List tools:
Call echo:
Call query_manse (first 5 rows):
Call calc_daewoon (example date):
Response example:
Meaning:
- asc_diff_days: 기준일 이후 다음 절기까지 (일수 / 3 반올림)
- desc_diff_days: 기준일 이전 직전 절기까지 (일수 / 3 반올림)
- 없으면 null
Environment Variables (DB)
Variable | Default | Description |
---|---|---|
MCP_DB_HOST | 192.168.31.136 | MariaDB host |
MCP_DB_PORT | 3306 | MariaDB port |
MCP_DB_USER | DB user | |
MCP_DB_PASSWORD | DB password | |
MCP_DB_NAME | manse | Database name |
Example run with overrides:
Run Tests
Next Ideas
- Streaming (SSE) outputs
- Prompts/resources primitives
- Auth layer (OAuth / API key)
- Tool change events
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A minimal FastAPI implementation that mimics Model Context Protocol functionality with JSON-RPC 2.0 support. Provides basic tools like echo and text transformation through both REST and RPC endpoints for testing MCP-style interactions.