How ajay-fitbit/mcp works
This repository provides an MCP interface for AI assistants to inspect and operate on SQL Server, with OpenAI and Python client options. The principal workflow is an assistant request routed through a client to the MCP server, which performs database connection, query, schema-discovery, or stored-procedure work and returns tool results. Stored-procedure test generation is a documented use case; its analysis and test-emission steps are not shown in sampled runtime code. Server capabilities share server.py; finer-grained boundaries reflect README tool descriptions. Non-README edges are based on excerpts.
Main entry points: server.py MCP tool server · openai_client.py OpenAI chat client · TEST_USP_AHS_AG_CARE_STAFF_ACTIVITIES_GET_INIT.sql Generated T-SQL tests · client.py Python MCP client
Components 13
Assistant clients
- OpenAI chat client
mcp-server-python/openai_client.py - Python MCP client
mcp-server-python/client.py - Simple MCP client
mcp-server-python/simple_client.py
MCP service
- MCP tool server
mcp-server-python/server.py
Database operations
- Connection lifecycle
mcp-server-python/server.py - Parameterized queries
mcp-server-python/server.py - Schema discovery
mcp-server-python/server.py - Procedure metadata
mcp-server-python/server.py - Procedure execution
mcp-server-python/server.py - Template queries
mcp-server-python/server.py
Procedure testing
- Generated T-SQL tests
mcp-server-python/TEST_USP_AHS_AG_CARE_STAFF_ACTIVITIES_GET_INIT.sql
Other components
- AI assistant
- SQL Server
Connections 18
- AI assistant → OpenAI chat client: asks questions
README.md - OpenAI chat client → MCP tool server: calls MCP tools
mcp-server-python/openai_client.py - AI assistant → MCP tool server: calls MCP tools
README.md - Python MCP client → MCP tool server: uses MCP
- Simple MCP client → MCP tool server: launches server
mcp-server-python/simple_client.py - MCP tool server → Connection lifecycle: dispatches tools
mcp-server-python/server.py - MCP tool server → Parameterized queries: dispatches tools
mcp-server-python/server.py - MCP tool server → Schema discovery: dispatches tools
mcp-server-python/server.py - MCP tool server → Procedure metadata: dispatches tools
README.md - MCP tool server → Procedure execution: dispatches tools
mcp-server-python/server.py - MCP tool server → Template queries: dispatches tools
mcp-server-python/server.py - Connection lifecycle → SQL Server: connects ODBC
README.md - Parameterized queries → SQL Server: runs queries
README.md - Schema discovery → SQL Server: inspects schema
README.md - Procedure metadata → SQL Server: inspects procedures
README.md - Procedure execution → SQL Server: executes procedures
README.md - AI assistant → Generated T-SQL tests: generates tests
README.md - Procedure metadata → Generated T-SQL tests: informs test cases
README.md