MCP cover image
See in Github
2025-04-05

测试创建简单的MCP服务器并与Langchain代理集成

1

Github Watches

0

Github Forks

0

Github Stars

mcd-demo

Testing creation of simple MCP servers and integrating with LangChain agent

Prerequisites

Create a virtual environment

python3 -m venv venv
source venv/bin/activate

Install dependencies

pip install -r requirements.txt

Set Environment variables

Set the following environment variables. Get the values from Azure AI Foundry where the models are deployed:

export AZURE_OPENAI_API_KEY=<your_azure_openai_api_key>
export AZURE_OPENAI_ENDPOINT=<your_azure_openai_endpoint>

Optionally, you can set the following environment variables to configure the MCP servers:

export MCP_MATH_URI=http://<server-uri>:5001/sse

Note: You can also set these variables in a .env file in the root directory of the project.

Running the agent

Start the MCP servers

You have to start all three MCP servers before starting the agent. Each server listens on a separate port. You can start them in separate terminals or run them in the background. To run in the background, do the following:

python weather_server.py &
python math_server.py &
python telemetry_server.py &

Alternatively, you can run the math server in a Docker container. To do this, first build the Docker image:

make build

Then, run the container:

make run-local

If you want to push the Docker image to a registry, tag and push it using the following commands:

make login
make push

Start the agent

python agent.py

Killing the MCP servers

pkill -9 -f weather_server.py
pkill -9 -f math_server.py
pkill -9 -f telemetry_server.py

相关推荐

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Lists Tailwind CSS classes in monospaced font

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • modelcontextprotocol
  • 模型上下文协议服务器

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

    Reviews

    4 (1)
    Avatar
    user_QQVYG7Nq
    2025-04-17

    As a devoted user of mcp applications, I found the mcd-demo by jspoelstra to be an impressive demonstration of practical functionality. The documentation is thorough, making it easy to get started quickly. Exploring the provided code on GitHub, I appreciated the clean and well-organized structure. Highly recommend checking it out: https://github.com/jspoelstra/mcd-demo.