Minimal MCP
A minimal implementation of Model Context Protocol (MCP) server and client for educational and development purposes.
Project Structure
Prerequisites
- Node.js 22+
- Python 3.13+
- TypeScript
Server Setup
Install Dependencies
Build Server
Test Server
Open the URL shown in the terminal (typically http://localhost:6274/
) to test
the server tools.
Client Setup
Create Virtual Environment
Install Dependencies
Configure Environment
Create .env
file with your OpenAI API key:
Run Client
Available Tools
The MCP server provides three tools:
- calculate_sum: Adds two numbers
- Parameters:
a
(number),b
(number) - Example:
calculate_sum(42, 58)
→100
- Parameters:
- reverse_string: Reverses a text string
- Parameters:
text
(string) - Example:
reverse_string('Hello MCP')
→'PCM olleH'
- Parameters:
- get_current_time: Returns current ISO timestamp
- Parameters: none
- Example:
get_current_time()
→'2025-08-24T01:52:39.749Z'
Usage Methods
Method 1: Direct Client Testing
Run the Python client to test all tools:
This will automatically:
- Connect to the MCP server
- Execute all three tools with sample data
- Display results
Method 2: Claude Code Integration
Add MCP server to Claude Code configuration:
Then use in Claude Code:
Method 3: MCP Inspector
Use the official MCP inspector for interactive testing:
Open the URL shown in the terminal to test tools interactively in the browser.
Development
Server Development
Adding New Tools
Edit server/src/index.ts
to add new tools:
- Add tool definition to the
tools
array:
- Add tool handler in the
CallToolRequestSchema
switch case:
- Rebuild the server:
Troubleshooting
Permission Denied
Inspector Port Issues
The inspector automatically finds available ports. If you see different port numbers in the output (e.g., proxy on 6277, web UI on 6274), this is normal. Use the URL shown in the terminal output.
Module Not Found
Check Node.js version and ensure all dependencies are installed:
Architecture
System Overview
Sequence Diagram
Demo
Installation and Setup
Method 1: Claude Code Integration
Add the MCP server directly to Claude Code:
Method 2: Global npm Installation
Install globally and configure manually:
Manual configuration for Claude Code:
Live Test Results
Here are actual test results from Claude Code integration:
1. Calculate Sum
2. Reverse String
3. Get Current Time
Python Client Test
You can also test with the included Python client:
Example output:
License
MIT
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A basic educational MCP server that provides simple tools for mathematical calculations, text manipulation, and time retrieval. Designed for learning MCP implementation patterns and development purposes.
Related MCP Servers
- -securityFlicense-qualityA server that provides basic mathematical operations (addition, subtraction, multiplication, division, power, square root) through MCP tools for use with AI assistants like Claude.Last updated -
- AsecurityFlicenseAqualityA comprehensive learning project providing hands-on experience with Model Context Protocol (MCP) server development, featuring calculator and text utility tools for integration with Claude Desktop.Last updated -1
- -securityFlicense-qualityA teaching repository that instructs non-technical users how to create Model Completion Protocol (MCP) servers for data analysis tasks, requiring only basic technical setup and understanding.Last updated -
- -securityFlicense-qualityA basic MCP server template built with FastMCP that provides simple tools for greeting users, performing math operations, and managing user information. Serves as a starting point for building custom MCP servers with essential functionality examples.Last updated -4