mcpserve-py
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcpserve-pylist all tables in the database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcpserve-py
A Model Context Protocol (MCP) server built in Python ā exposes database query tools and document resources over JSON-RPC 2.0 stdio transport, enabling AI assistants to interact with SQLite databases and markdown documents.
What is MCP?
The Model Context Protocol is an open standard for connecting AI assistants to external tools and data sources. MCP servers expose tools (functions the AI can call) and resources (data the AI can read) over a JSON-RPC 2.0 transport.
This server implements the MCP protocol from scratch using raw JSON-RPC 2.0 over stdio ā no SDK dependency required.
Related MCP server: SQLite MCP Server
Features
š§ 8 tools ā database queries, document CRUD, search, date/time
š Resource providers ā documents and database schemas as readable resources
š”ļø SQL injection protection ā only SELECT queries allowed, with regex validation
š YAML frontmatter ā documents stored as markdown with structured metadata
š Stdio transport ā line-delimited JSON-RPC 2.0 over stdin/stdout
ā” Zero SDK dependency ā hand-rolled MCP protocol implementation
ā Well-tested ā 113 tests covering protocol, tools, resources, and integration
Quick Start
# Clone and install
git clone https://github.com/devaloi/mcpserve-py.git
cd mcpserve-py
pip install -e ".[dev]"
# Run the server
python -m mcpserve_py
# Run tests
python -m pytest -vEnvironment Variables
Variable | Default | Description |
|
| Directory for documents and data |
|
| Path to SQLite database |
|
| Log level (DEBUG, INFO, WARNING, ERROR) |
Claude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"mcpserve-py": {
"command": "python",
"args": ["-m", "mcpserve_py"],
"env": {
"MCPSERVE_DATA_DIR": "./data",
"MCPSERVE_DB_PATH": "./data/mcpserve.db"
}
}
}
}Tools
Tool | Description | Parameters |
| Execute read-only SQL query |
|
| List all tables in database | ā |
| Get table schema |
|
| Create a markdown document |
|
| Read document by title |
|
| List all documents |
|
| Full-text search across documents |
|
| Current date/time |
|
Resources
URI Pattern | Description | MIME Type |
| Document content |
|
| Full database schema |
|
| Single table schema |
|
Architecture
src/mcpserve_py/
āāā __main__.py # Entry point: python -m mcpserve_py
āāā server.py # MCP server: receive ā dispatch ā respond
āāā protocol.py # JSON-RPC 2.0 types and encoding
āāā transport.py # Stdio transport (line-delimited JSON)
āāā config.py # Pydantic settings
āāā tools/
ā āāā registry.py # Tool registry
ā āāā database.py # SQLite tools (query, list_tables, describe)
ā āāā documents.py # Document tools (CRUD + search)
ā āāā system.py # System tools (get_datetime)
āāā resources/
āāā provider.py # Resource provider interface + registry
āāā documents.py # Document resource provider
āāā database.py # Database schema resource providerDesign Decisions
No MCP SDK ā The protocol is implemented directly using JSON-RPC 2.0 dataclasses. This demonstrates deep understanding of the protocol rather than SDK usage.
Synchronous ā Stdio is inherently sequential; async adds complexity without benefit here.
Pydantic Settings ā Configuration via environment variables with type validation and
.envfile support.Tool registry pattern ā Tools register themselves with a central registry, keeping the server dispatch clean.
Read-only SQL ā Mutations are rejected via regex before reaching SQLite, preventing data corruption by AI assistants.
YAML frontmatter ā Documents use the same format as static site generators (Jekyll, Hugo), making them human-readable and tool-friendly.
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
make test
# Lint
make lint
# Type check
make typecheck
# Format
make format
# All checks
make allLicense
MIT
Contributing
See CONTRIBUTING.md. PRs welcome ā run make all before submitting.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceA Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.Last updated7MIT
- Alicense-qualityDmaintenanceImplements a Model Context Protocol server that enables natural language interactions with SQLite databases, providing tools to list tables, retrieve schemas, count rows, and execute read-only SQL queries.Last updatedMIT
- AlicenseAqualityCmaintenanceExposes local file I/O, a restricted shell whitelist, and SQLite helpers for safe integration with AI clients like Cursor and Claude Desktop.Last updated7MIT
- Alicense-qualityCmaintenanceRead-only MCP server for SQLite databases, enabling AI assistants to safely query and inspect database schemas without write access.Last updatedMIT
Related MCP Connectors
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/devaloi/mcpserve-py'
If you have feedback or need assistance with the MCP directory API, please join our Discord server