
Store and retrieve entities, relations and observations in a persistent local knowledge graph.

An MCP server that provides AI message tools for Claude, OpenAI, and mock services, with stdio, TCP, and WebSocket transports.
Modular Model Context Protocol server for AI services is cataloged as an MCP server attributed to shaswata56. An MCP server that provides AI message tools for Claude, OpenAI, and mock services, with stdio, TCP, and WebSocket transports. It is categorized under ai agents-models. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Modular Model Context Protocol server for AI services are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes, the service can be selected per request by specifying a service_name of claude, openai, or mock, or omitted for the default.
It supports stdio, TCP, and WebSocket transports.
README.md · cfcbb1b9a308 · 采集于 2026-11-13 11:44:39 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
A modular Model Context Protocol server for AI services with multiple transport options and dynamic service selection. Built with SOLID principles for maintainability and extensibility.
.env filebasic-mcp-server/
├── .env # Environment configuration
├── .gitignore # Git ignore rules
├── README.md # Project documentation
├── examples/ # Example clients
│ ├── example_client.py # Command-line client example
│ └── websocket_client.html # Browser WebSocket client
├── mcp_server.py # Main entry point
└── mcp_server/ # Core package
├── config/ # Configuration management
│ ├── settings.py # Environment and settings handling
│ └── __init__.py
├── core/ # Core server logic
│ ├── server.py # Main server implementation
│ └── __init__.py
├── handlers/ # Method handlers
│ ├── base_handlers.py # Standard MCP handlers
│ ├── system_handlers.py # System info handlers
│ └── __init__.py
├── models/ # Data models
│ ├── json_rpc.py # JSON-RPC data structures
│ └── __init__.py
├── services/ # AI service implementations
│ ├── claude_service.py # Anthropic Claude API
│ ├── openai_service.py # OpenAI API
│ └── __init__.py # Service registry
├── transports/ # Communication protocols
│ ├── base.py # Transport interfaces
│ ├── websocket.py # WebSocket implementation
│ └── __init__.py
└── __init__.py
Clone the repository:
git clone https://github.com/shaswata56/basic-mcp-server.git
cd basic-mcp-server
Create a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e .
Configure your environment by editing the .env file with your API keys and settings.
The server can be configured using environment variables in the .env file:
| Variable | Description | Default |
|---|---|---|
AI_SERVICE_TYPE | Default AI service to use ("claude", "openai", "mock") | "claude" |
SECRETS_FILE | Path to JSON file with API secrets | None |
ANTHROPIC_API_KEY | Your Anthropic API key | None |
OPENAI_API_KEY | Your OpenAI API key | None |
MCP_SERVER_NAME | Name of the server | "ai-mcp-server" |
MCP_SERVER_VERSION | Server version | "1.0.0" |
MCP_TRANSPORT_TYPE | Transport type ("stdio", "tcp", or "websocket") | "stdio" |
MCP_TCP_HOST | TCP/WebSocket host address | "127.0.0.1" |
MCP_TCP_PORT | TCP server port | 9000 |
MCP_WS_PORT | WebSocket server port | 8765 |
MCP_WS_PATH | WebSocket server path | "/" |
MCP_WS_ORIGINS | Comma-separated list of allowed origins | None (all allowed) |
CLAUDE_DEFAULT_MODEL | Default Claude model | "claude-3-opus-20240229" |
CLAUDE_DEFAULT_MAX_TOKENS | Default max tokens for Claude | 4096 |
CLAUDE_DEFAULT_TEMPERATURE | Default temperature for Claude | 0.7 |
OPENAI_DEFAULT_MODEL | Default OpenAI model | "gpt-4o" |
OPENAI_DEFAULT_MAX_TOKENS | Default max tokens for OpenAI | 1024 |
OPENAI_DEFAULT_TEMPERATURE | Default temperature for OpenAI | 0.7 |
| EMBEDDINGS_3_LARGE_API_URL | Azure endpoint for text-embedding-3-large | None |
| EMBEDDINGS_3_LARGE_API_KEY | API key for text-embedding-3-large | None |
| EMBEDDINGS_3_SMALL_API_URL | Azure endpoint for text-embedding-3-small | None |
| EMBEDDINGS_3_SMALL_API_KEY | API key for text-embedding-3-small | None |
| AZURE_OPENAI_EMBEDDING_DEPLOYMENT | Azure deployment name for embeddings | <model name> |
| QDRANT_URL | URL of the Qdrant server (use :memory: for in-memory) | None |
| QDRANT_API_KEY | API key for Qdrant Cloud | None |
When embedding API credentials are not provided, the server will generate deterministic mock embeddings so that testing can proceed without external services.
For production deployments, configure QDRANT_URL to point to a dedicated
Qdrant server. Using a remote server provides persistent storage and improved
vector search performance compared to the default in-memory mode.
The optional SECRETS_FILE variable allows you to store API keys in a JSON
file instead of environment variables. Values defined in the secrets file are
used when corresponding environment variables are not set. If a secret value is
an array, the server will rotate through the values each time the key is
requested, enabling simple key rotation strategies.
python mcp_server.py
python mcp_server.py --tcp --host 127.0.0.1 --port 9000
python mcp_server.py --websocket --host 127.0.0.1 --port 8765 --ws-path /
usage: mcp_server.py [-h] [--tcp | --websocket] [--host HOST] [--port PORT]
[--ws-path WS_PATH] [--service-type {claude,openai,mock}]
[--claude-api-key CLAUDE_API_KEY]
[--openai-api-key OPENAI_API_KEY]
[--qdrant-url QDRANT_URL]
[--qdrant-api-key QDRANT_API_KEY] [--mock]
[--log-level {DEBUG,INFO,WARNING,ERROR}]
[--env-file ENV_FILE]
AI MCP Server with JSON-RPC
options:
-h, --help show this help message and exit
--log-level {DEBUG,INFO,WARNING,ERROR}
Logging level
--env-file ENV_FILE Path to .env file (default: .env in project root)
Transport Options:
--tcp Run as TCP server
--websocket Run as WebSocket server
--host HOST Host to bind server
--port PORT Port for server
--ws-path WS_PATH URL path for WebSocket server (default: /)
AI Service Options:
--service-type {claude,openai,mock}
AI service to use
--claude-api-key CLAUDE_API_KEY
Anthropic API key
--openai-api-key OPENAI_API_KEY
OpenAI API key
--qdrant-url QDRANT_URL
Qdrant server URL
--qdrant-api-key QDRANT_API_KEY
Qdrant API key
--mock Use mock AI service (for testing)
The examples/example_client.py provides a simple way to interact with the server:
# Initialize connection
python examples/example_client.py initialize
# List available tools
python examples/example_client.py list-tools
# Echo text
python examples/example_client.py echo "Hello, world!"
# Calculate expression
python examples/example_client.py calculate "2 + 3 * 4"
# Ask AI with dynamic service selection
python examples/example_client.py ask "What is the capital of France?" --service claude
# System information
python examples/example_client.py system-info
For WebSocket transport, open examples/websocket_client.html in a browser:
ws://localhost:8765/){
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "ai/message",
"arguments": {
"prompt": "What is the capital of France?",
"service_name": "claude" // Optional: "claude", "openai", "mock" or omit for default
}
},
"id": 1
}
Claude:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "claude/message",
"arguments": {
"prompt": "What is the capital of France?"
}
},
"id": 2
}
OpenAI:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "openai/message",
"arguments": {
"prompt": "What is the capital of France?"
}
},
"id": 3
}
| Method | Description |
|---|---|
initialize | Initialize the server connection |
tools/list | List available tools |
tools/call | Call a tool with arguments |
resources/list | List available resources |
resources/read | Read a resource |
system/info | Get system information |
system/health | Check system health |
HandlerInterface in the handlers directoryAIMCPServerApp.initialize() methodAIServiceInterface in the services directorycreate_ai_services_from_config()Transport class in the transports directoryWhen using a TLS/SSL-terminating load balancer (like AWS ELB) in front of this server:
wss://)ws://)Processing very large repositories, especially C# projects, can generate many database operations. Consider batching inserts or using alternative storage strategies if you encounter performance issues with MongoDB.
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Modular Model Context Protocol server for AI services from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/basic-mcp-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

Store and retrieve entities, relations and observations in a persistent local knowledge graph.

Organize problem solving into revisable, branching thought steps through an MCP tool.

Query-aware context compression with an MCP plugin for coding agents, plus Python and HTTP interfaces for reducing the context sent to a language model.