About Tool Server
Tool Server is an MCP server published by BabyChrist666 in the Developer Tools category: mcp-tool-server. It has been installed 0 times through Conduid.
Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.
Install
npx mcp-tool-serverThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Tool Server
Powered by Claude · Grounded in docs
Security checks
- ·README presentNot checked yet.
- ·License declaredNot checked yet.
- ·Tests presentNot checked yet.
- ·Dependencies pinnedNot checked yet.
- ·No dynamic code executionNot checked yet.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
MCP Tool Server
Production-ready Model Context Protocol (MCP) server with file, shell, and search tools.
MCP enables AI assistants to interact with external tools and data sources through a standardized interface. This server provides a complete implementation with built-in tools for common operations.
Installation
pip install -r requirements.txt
Quick Start
import asyncio
from mcp_server import MCPServer, ServerConfig, create_server
# Create server with default tools
server = create_server()
# Or customize configuration
config = ServerConfig(
name="my-mcp-server",
allowed_paths=["/home/user/projects"],
enable_shell_tools=True,
)
server = create_server(config=config)
# Run the server
asyncio.run(server.run())
Built-in Tools
file_read
Read file contents with path restrictions and size limits.
{
"name": "file_read",
"arguments": {
"path": "/path/to/file.txt",
"encoding": "utf-8"
}
}
file_write
Write or append content to files.
{
"name": "file_write",
"arguments": {
"path": "/path/to/file.txt",
"content": "Hello, world!",
"mode": "write"
}
}
shell
Execute shell commands with security controls.
{
"name": "shell",
"arguments": {
"command": "ls -la",
"timeout": 30
}
}
search
Search for patterns in files (grep-like).
{
"name": "search",
"arguments": {
"pattern": "TODO",
"path": "/path/to/project",
"include": "*.py",
"ignore_case": true
}
}
glob
Find files matching a glob pattern.
{
"name": "glob",
"arguments": {
"pattern": "**/*.py",
"path": "/path/to/project"
}
}
Custom Tools
Create your own tools by extending BaseTool:
from mcp_server import BaseTool, ToolParameter, ToolResult
class WeatherTool(BaseTool):
@property
def name(self) -> str:
return "weather"
@property
def description(self) -> str:
return "Get current weather for a location"
@property
def parameters(self):
return [
ToolParameter("location", "string", "City name", required=True),
]
def execute(self, location: str) -> ToolResult:
# Your implementation here
return ToolResult(
success=True,
content=f"Weather for {location}: Sunny, 72F",
)
# Register with server
server.register_tool(WeatherTool())
Transport Options
Stdio (Default)
Communication via stdin/stdout with JSON-RPC framing:
from mcp_server import StdioTransport
transport = StdioTransport()
await server.run(transport)
WebSocket
For web-based integrations:
from mcp_server import WebSocketTransport
# Requires a WebSocket connection (e.g., from websockets library)
transport = WebSocketTransport(websocket)
await server.run(transport)
Security Features
Path Restrictions
Limit file operations to specific directories:
config = ServerConfig(
allowed_paths=["/home/user/projects", "/tmp"],
)
Command Filtering
Block dangerous shell commands:
from mcp_server import ShellTool
tool = ShellTool(
blocked_commands=["rm -rf /", "mkfs"],
allowed_commands=["ls", "cat", "grep"], # Whitelist mode
timeout=30,
)
Request Limits
Control concurrent requests and timeouts:
config = ServerConfig(
max_concurrent_requests=10,
request_timeout=60.0,
)
Protocol
Implements MCP with JSON-RPC 2.0:
// Request
{
"jsonrpc": "2.0",
"id": "1",
"method": "tools/call",
"params": {
"name": "file_read",
"arguments": {"path": "/etc/hostname"}
}
}
// Response
{
"jsonrpc": "2.0",
"id": "1",
"result": {
"content": [{"type": "text", "text": "myhost\n"}]
}
}
Standard Methods
| Method | Description |
|---|---|
initialize |
Initialize connection, exchange capabilities |
initialized |
Client notification after init complete |
tools/list |
List available tools |
tools/call |
Execute a tool |
shutdown |
Request server shutdown |
ping |
Health check |
Testing
pytest tests/ -v
112 tests covering:
- Protocol message parsing and serialization
- Tool execution and validation
- Transport layer (stdio, websocket)
- Server lifecycle and request handling
License
MIT
README mirrored from the source repository 21 days ago. The original is authoritative.