MCP服务器实现

Omni Server是一个基于Python的MCP服务器实现,旨在帮助开发者熟悉MCP框架,并与Claude Desktop无缝集成。

  • by abhijithk1
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 abhijithk1/omni-server

使用说明

Omni服务器

Omni服务器 是一个模型上下文协议(MCP)服务器,旨在帮助开发人员熟悉MCP框架。它是理解和实现基于MCP的应用程序的基础工具。


特性

  • 🚀 使用Python实现MCP服务器
  • 📁 模块化项目结构,提示、工具、数据和资源明确分离
  • ⚙️ 易于配置 .env 诗歌
  • 🧠 旨在与无缝集成 克劳德桌面

项目结构

omni-server/
├── data/           # Data files and datasets
├── prompts/        # Prompt templates and related files
├── resources/      # Static resources and assets
├── tools/          # Utility scripts and tools
├── utils/          # Helper functions and utilities
├── .env            # Environment variable definitions
├── .gitignore      # Git ignore rules
├── .python-version # Python version specification
├── README.md       # Project documentation
├── main.py         # Main application entry point
├── pyproject.toml  # Project metadata and dependencies
├── server.py       # Server initialization and configuration
└── uv.lock         # Dependency lock file

入门指南

先决条件

  • Python 3.8或更高版本
  • 紫外线 用于依赖关系管理

安装

  1. 克隆存储库:
git clone https://github.com/abhijithk1/omni-server.git
cd omni-server
  1. 使用uv安装依赖项:
uv venv
uv pip install -r requirements.txt  # if using requirements.txt

# or, better:
uv pip install -e .  # if pyproject.toml is used
  1. 激活虚拟环境(如果需要):
source .venv/bin/activate  # macOS/Linux
.venv\Scripts\activate     # Windows
  1. 创建一个 .env 文件 (如果需要)使用任何必要的环境变量。

依赖项

所有必需的包都在中定义 pyproject.toml。您可以使用以下方式安装它们:

uv pip install -e .

运行服务器

通过终端手动运行:

uv pip install -e .  # ensure it's installed
python main.py

或者,如果您正在使用虚拟环境:

.venv/Scripts/python.exe main.py

🧩 与Claude Desktop集成

使用此服务器 克劳德桌面,配置您的 claude_desktop_config.json 像这样:

{
  "mcpServers": {
    "omni_server": {
      "command": "<PATH TO PROJECT>/.venv/Scripts/python.exe",
      "args": [
        "<PATH TO PROJECT>/main.py"
      ],
      "cwd": "<PATH TO PROJECT>"
    }
  }
}

确保:

  • Python可执行文件的路径正确
  • 您的虚拟环境(.vnv)是通过uv创建和安装的
  • Claude Desktop已配置为识别MCP服务器

一旦完成,Omni Server将作为Claude Desktop内的MCP兼容后端运行!


贡献

欢迎投稿!分叉存储库,进行更改,然后打开一个pull请求。


许可证

该项目根据MIT许可证获得许可。请参阅 许可证 文件以获取详细信息。