MCP From-Scratch Implementation
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., "@MCP From-Scratch ImplementationWhat phase are you in and what can I test with this server?"
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.
MCP From-Scratch Implementation
An MCP (Model Context Protocol) implementation built from scratch, primarily to learn and understand how MCP works under the hood.
The project evolves incrementally through defined phases, starting from the smallest possible working implementation and growing toward a production-grade MCP server. It is intended to serve both as a learning reference and as a real MCP server for integration testing with other AI/LLM/agent codebases.
Status: Phase 1 — Minimal MCP server. A JSON-RPC 2.0 message loop with the
initialize/pinghandshake over stdio. Tools, resources, and prompts arrive in later phases.
What is MCP?
MCP is an open protocol that standardizes how applications (hosts) give large language models (LLMs) access to external data and tools. It defines a client–server architecture:
User
|
v
LLM / Agent
|
v
MCP Client
| MCP Protocol
v
MCP Server
|
+---- Tool
|
+---- Resource
|
+---- Prompt
|
v
External SystemThe three core server primitives are:
Tools — "do something" (actions the LLM can invoke).
Resources — "give me information/data" (data the LLM can read).
Prompts — reusable prompt templates.
Deeper explanations of each concept are added to docs/ as the project
progresses.
Related MCP server: MCP AI Chat LangChain
Project Structure
.
├── src/
│ └── mcp_server/ # The MCP server package (grows over phases)
│ ├── __init__.py # package exports (public API)
│ ├── protocol.py # JSON-RPC 2.0 messages / parsing
│ ├── server.py # Server: dispatch, initialize, ping
│ ├── stdio.py # stdio transport loop
│ └── __main__.py # `python -m mcp_server`
├── tests/ # Automated tests (pytest)
├── examples/ # Runnable example applications
├── docs/ # Concept + design documentation
├── .github/ # Repository configuration/instructions
├── .gitignore
├── README.md
├── pyproject.toml
└── uv.lockSetup
Requirements:
uv (Python 3.11+)
Create the virtual environment and install dependencies (including dev dependencies) from the project root:
uv syncThis creates .venv/ and installs the project in editable mode plus pytest.
Running the Server
The server speaks JSON-RPC 2.0 over stdio: each message is one JSON object per line on standard input, with responses written to standard output.
uv run mcp-serveror equivalently:
uv run python -m mcp_serverFor example, sending an initialize request and a ping:
$ printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' \
'{"jsonrpc":"2.0","id":2,"method":"ping"}' | uv run mcp-server
{"jsonrpc": "2.0", "id": 1, "result": {"protocolVersion": "2025-06-18", "capabilities": {}, "serverInfo": {"name": "mcp-server", "version": "0.2.0"}}}
{"jsonrpc": "2.0", "id": 2, "result": {}}Running the Tests
uv run pytestDevelopment Roadmap
The project is developed in phases (see .github/copilot-instructions.md for
full details):
Phase | Focus |
0 | Project foundation (this phase) |
1 | Minimal MCP server |
2 | Tools |
3 | Resources |
4 | Prompts |
5 | MCP client |
6 | LLM / agent integration |
7 | Error handling and validation |
8 | Logging and observability |
9 | Configuration and secrets |
10 | Authentication and authorization |
11 | Testing |
12 | Transport and deployment |
13 | Security hardening |
14 | Production-grade MCP server |
Coding Guidelines
Modern Python with type hints.
Small functions, clear naming, explicit error handling.
Interfaces/abstractions only when justified.
pytestfor testing.Dependencies are added only with justification.
License
(Not yet specified.)
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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 Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceThis server implements the Model Context Protocol to facilitate meaningful interaction and understanding development between humans and AI through structured tools and progressive interaction patterns.57-
- FlicenseNot gradedqualityDmaintenanceA basic Model Context Protocol server implementation that demonstrates core functionality including tools and resources for AI chat applications.-
- FlicenseNot gradedqualityDmaintenanceA foundational implementation of a Model Context Protocol (MCP) server designed for educational purposes. It demonstrates the complete interaction between an LLM, an inference engine, and a client during an agentic call.-
- AlicenseNot gradedqualityDmaintenanceModel Context Protocol server that standardizes tool discovery, execution, and context management for AI applications.MIT
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/abhisheksonsale/MCP_implementation'
If you have feedback or need assistance with the MCP directory API, please join our Discord server