Skip to main content
Glama

MCP Server Demo

by tian1ll1

MCP 服务器演示

该项目演示了模型上下文协议 (MCP) 服务器的实现。MCP 是一种旨在促进 AI 模型与外部工具/服务之间通信,同时保持上下文感知的协议。

特征

  • 基本 MCP 服务器实现
  • 工具集成示例
  • 上下文管理演示
  • 基于WebSocket的实时通信
  • 简单客户端示例

项目结构

mcp-server-demo/ ├── src/ │ ├── server.py # Main MCP server implementation │ ├── tools/ # Tool implementations │ │ ├── __init__.py │ │ └── basic_tools.py │ ├── context/ # Context management │ │ ├── __init__.py │ │ └── manager.py │ └── utils/ # Utility functions │ ├── __init__.py │ └── helpers.py ├── examples/ # Example usage │ ├── client.py │ └── tools_demo.py ├── tests/ # Test cases │ └── test_server.py ├── requirements.txt # Project dependencies └── README.md # This file

安装

  1. 克隆存储库:
git clone https://github.com/tian1ll1/mcp-server-demo.git cd mcp-server-demo
  1. 创建虚拟环境(推荐):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
  1. 安装依赖项:
pip install -r requirements.txt

用法

  1. 启动 MCP 服务器:
python src/server.py
  1. 运行示例客户端:
python examples/client.py

工作原理

MCP 服务器实现了以下关键组件:

  1. 上下文管理:维护每个会话的对话历史和相关上下文。
  2. 工具注册表:管理可用的工具及其规格。
  3. 消息处理:处理传入消息并将其路由到适当的工具。
  4. WebSocket 服务器:提供与客户端的实时通信。

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

-
security - not tested
F
license - not found
-
quality - not tested

模型上下文协议服务器的演示实现,促进 AI 模型与外部工具之间的通信,同时保持上下文感知。

  1. 特征
    1. 项目结构
      1. 安装
        1. 用法
          1. 工作原理
            1. 贡献
              1. 执照

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  A starter template for building Model Context Protocol servers that can be integrated with Cursor or Claude Desktop, allowing developers to create custom tools and extensions for AI assistants.
                  Last updated -
                  1
                  6
                  9
                  TypeScript
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that provides a comprehensive interface for interacting with the ConnectWise Manage API, simplifying API discovery, execution, and management for both developers and AI assistants.
                  Last updated -
                  46
                  2
                  Python
                  • Linux
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that enables role-based context management for AI agents, allowing users to establish specific instructions, maintain partitioned memory, and adapt tone for different agent roles in their system.
                  Last updated -
                  TypeScript
                • -
                  security
                  -
                  license
                  -
                  quality
                  A Model Context Protocol server implementation that enables AI assistants to interact with Linear project management systems, allowing them to create, retrieve, and modify data related to issues, projects, teams, and users.
                  Last updated -
                  20
                  2
                  TypeScript

                View all related MCP servers

                MCP directory API

                We provide all the information about MCP servers via our MCP API.

                curl -X GET 'https://glama.ai/api/mcp/v1/servers/tian1ll1/mcp-server-demo'

                If you have feedback or need assistance with the MCP directory API, please join our Discord server