loading…
Search for a command to run...
loading…
A general-purpose MCP server that provides utility tools for echo, date/time, and file operations within Claude Code and Claude Desktop. It functions as an exte
A general-purpose MCP server that provides utility tools for echo, date/time, and file operations within Claude Code and Claude Desktop. It functions as an extensible framework designed to help developers easily build and register custom Python-based tools.
A general-purpose Model Context Protocol (MCP) server that provides tools for Claude Code and Claude Desktop.
# Install dependencies
cd mcp-server
pip install -r requirements.txt
# Test the server runs (Ctrl+C to stop)
PYTHONPATH=src python -m mcp_server.server
mcp-server/
├── src/mcp_server/
│ ├── server.py # Main FastMCP server
│ ├── config.py # Environment-based configuration
│ └── tools/
│ ├── __init__.py # Tool registry
│ ├── echo_tool.py # Example: basic echo tools
│ ├── datetime_tool.py # Example: date/time utilities
│ └── file_tool.py # Example: file operations
├── configs/ # Client configuration templates
└── requirements.txt
The server is configured via environment variables:
| Variable | Description | Default |
|---|---|---|
MCP_SERVER_NAME |
Display name for the server | mcp-server |
MCP_LOG_LEVEL |
Logging level (DEBUG, INFO, WARNING, ERROR) | INFO |
MCP_ALLOWED_PATHS |
Comma-separated paths for file tools | (none) |
MCP_CUSTOM_VAR_* |
Custom variables accessible via config | (none) |
echo - Echo back a messageecho_uppercase - Echo in uppercaseecho_reverse - Echo reversedget_current_time - Get current UTC timeget_timestamp - Get current Unix timestampparse_timestamp - Convert timestamp to readable formattime_difference - Calculate time between two timestampsMCP_ALLOWED_PATHS)list_directory - List directory contentsread_file - Read file contentsget_file_info - Get file/directory metadataget_allowed_paths - Show configured allowed paths~/Library/Application Support/Claude/claude_desktop_config.json (macOS){
"mcpServers": {
"my-mcp-server": {
"command": "python",
"args": ["-m", "mcp_server.server"],
"cwd": "/full/path/to/mcp-server",
"env": {
"PYTHONPATH": "/full/path/to/mcp-server/src",
"MCP_ALLOWED_PATHS": "/Users/you/Documents"
}
}
}
}
Create .mcp.json in your project root:
{
"mcpServers": {
"my-mcp-server": {
"command": "python",
"args": ["-m", "mcp_server.server"],
"cwd": "${workspaceFolder}/mcp-server",
"env": {
"PYTHONPATH": "${workspaceFolder}/mcp-server/src",
"MCP_ALLOWED_PATHS": "${workspaceFolder}"
}
}
}
}
src/mcp_server/tools/:# src/mcp_server/tools/my_tool.py
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mcp.server.fastmcp import FastMCP
from ..config import ServerConfig
def register(mcp: "FastMCP", config: "ServerConfig") -> None:
"""Register my tools with the server."""
@mcp.tool()
def my_function(param: str, count: int = 1) -> str:
"""
Description shown to Claude.
Args:
param: What this parameter does
count: Optional count with default
Returns:
What the tool returns
"""
return f"Result: {param} x {count}"
src/mcp_server/tools/__init__.py:def register_all_tools(mcp: "FastMCP", config: "ServerConfig") -> None:
from . import echo_tool, datetime_tool, file_tool, my_tool # Add import
echo_tool.register(mcp, config)
datetime_tool.register(mcp, config)
file_tool.register(mcp, config)
my_tool.register(mcp, config) # Add registration
config for environment-specific settings (like allowed paths)Server won't start:
PYTHONPATH includes the src directorymcp package is installed: pip install mcp[cli]Tools not appearing in Claude:
cwd path is correctFile tools return "not in allowed directories":
MCP_ALLOWED_PATHS to comma-separated directory pathsmcp[cli]>=1.0.0Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"mcp-server-framework": {
"command": "npx",
"args": []
}
}
}