# Ticket: Implement Minimal MCP Server ## Ticket Information - **ID**: TICKET-029 - **Title**: Implement Minimal MCP Server - **Type**: Feature - **Priority**: High - **Status**: Done - **Track**: Tools/MCP - **Milestone**: Milestone 1 - Survey & Architecture - **Created**: 2024-01-XX ## Description Build a minimal MCP server: - One service exposing a few tools (e.g., weather, echo) - JSON-RPC protocol implementation - Tools/call and tools/list endpoints - Basic error handling ## Acceptance Criteria - [x] MCP server implemented (`home-voice-agent/mcp-server/`) - [x] JSON-RPC protocol working (JSON-RPC 2.0 via FastAPI) - [x] Tools/list endpoint functional (`/mcp` with method `tools/list`) - [x] Tools/call endpoint functional (`/mcp` with method `tools/call`) - [x] At least 2 example tools (weather, echo) implemented - [x] Error handling implemented (proper JSON-RPC error codes) ## Technical Details Implementation: - JSON-RPC 2.0 server - Tool registration system - Request/response handling - Error codes and messages ## Dependencies - TICKET-028 (MCP concepts) ## Related Files - `home-voice-agent/mcp-server/` (to be created) ## Related Files - `home-voice-agent/mcp-server/` (to be created) ## Notes Independent of specific tools - start with stubs. Can be tested with dummy models. ## Progress Log - 2024-01-XX - MCP server implemented with FastAPI - 2024-01-XX - JSON-RPC 2.0 protocol implemented - 2024-01-XX - Tool registry system created - 2024-01-XX - Echo and Weather tools implemented - 2024-01-XX - Test script created (`test_mcp.py`) - 2024-01-XX - Ready for testing and integration ## Implementation Details **Location**: `home-voice-agent/mcp-server/` **Components**: - `server/mcp_server.py` - Main FastAPI server with JSON-RPC 2.0 handler - `tools/registry.py` - Tool registration and execution system - `tools/base.py` - Base tool interface - `tools/echo.py` - Echo tool for testing - `tools/weather.py` - Weather tool (stub implementation) **To Run**: ```bash cd home-voice-agent/mcp-server pip install -r requirements.txt python server/mcp_server.py ``` **To Test**: ```bash python test_mcp.py ```