MCP Server
MCP 服务器
一个使用 FastAPI 构建的模块化模型上下文协议 (MCP) 服务器,为 LLM 交互提供工具。
功能特性
模块化架构 - 每个工具都易于维护
文件操作 - 读取、写入、追加、替换和插入文件中的文本
网络搜索 - 使用 DDGS 进行实时网络搜索
URL 获取 - 抓取并总结网页内容
命令执行 - 在沙箱环境中运行 shell 命令
严格隔离 - 使用 Bubblewrap 沙箱和一次性
/tmp目录
Related MCP server: mcp-toolkit
工具
工具 | 描述 |
| 获取今天的日期和时间 |
| 将两个数字相加 |
| 搜索实时网络信息 |
| 抓取 URL 并提取内容 |
| 列出文件和目录 |
| 使用基于行的窗口读取文件 |
| 将文本写入文件 |
| 将文本追加到现有文件 |
| 在文件中查找并替换文本 |
| 在标记行后插入文本 |
| 在沙箱中执行 shell 命令 |
安装
# Clone the repository
git clone <repository-url>
cd mcp_server
# Install dependencies using uv
uv sync使用方法
# Start the server
python main.py服务器将在 http://0.0.0.0:8000 启动。
架构
mcp_server/
├── main.py # FastAPI application entry point
├── tools.json # Tool definitions (JSON schema)
└── tools/ # Tool implementations
├── __init__.py # Exports all handlers
├── add.py # Math operations
├── today.py # Date/time
├── web_search.py # Web search
├── fetch_content.py # URL scraping
├── files.py # All file operations
└── run_command.py # Shell command execution沙箱配置
run_command 工具使用 bubblewrap 进行隔离:
只读根文件系统 (
--ro-bind / /)一次性临时目录 (
--tmpfs /tmp)可写资源目录 (
--bind resources resources)启用 DNS 解析 (无
/etc限制)
免责声明
本项目是在阿里巴巴集团通义实验室的大型语言模型 Qwen 3.6 的协助下开发的。虽然 AI 协助了代码生成、文档编写和重构,但所有技术决策和最终实现均由人类开发者审查和验证。
许可证
MIT 许可证
This server cannot be deployed
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- AlicenseAqualityFmaintenanceAn MCP server that enables secure terminal command execution, directory navigation, and file system operations through a standardized interface for LLMs.1097MIT
- AlicenseAqualityDmaintenanceA general-purpose MCP server providing web search, persistent memory storage, and secure code execution capabilities. It enables AI agents to search the web, store and retrieve data, and run Python/JavaScript code in sandboxed environments.8MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive MCP server enabling LLMs to execute commands, manage files, interact with Figma, search the web, generate images, and more, extending their capabilities beyond text generation.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA secure, production-grade MCP server that provides filesystem operations, AST math evaluation, and system diagnostics for LLM agents.MIT