Skip to main content
Glama

Azure OpenAI

by kimtth

使用 Azure OpenAI 的 MCP 服务器和客户端实现

  • 利用模型上下文协议 (MCP) 和 Azure OpenAI 的最小服务器/客户端应用程序实现。
    1. MCP 服务器是用FastMCP构建的。
    2. Playwright是 Microsoft 推出的一个开源、端到端测试框架,用于测试现代 Web 应用程序。
    3. MCP 对工具的响应将转换为 OpenAI 函数调用格式。
    4. 将 MCP 服务器响应转换为 OpenAI 函数调用格式的桥梁定制了MCP-LLM Bridge实现。
    5. 为了确保稳定的连接,服务器对象被直接传递到桥中。

模型上下文协议(MCP)

模型上下文协议 (MCP) MCP(模型上下文协议)是一种开放协议,可实现 AI 应用程序与本地或远程资源之间的安全、受控交互。

官方存储库

社区资源

相关项目

  • FastMCP :构建 MCP 服务器的快速、Python 方式。
  • 聊天 MCP : MCP 客户端
  • MCP-LLM Bridge :MCP 实现,支持 MCP 服务器与 OpenAI 兼容的 LLM 之间的通信

MCP剧作家

配置

在 2024 年 12 月的开发阶段,Python 项目应以“uv”启动。其他依赖管理库,例如“pip”和“poetry”,尚未得到 MCP CLI 的完全支持。

  1. .env.template重命名为.env ,然后在.env中填写 Azure OpenAI 的值:
    AZURE_OPEN_AI_ENDPOINT= AZURE_OPEN_AI_API_KEY= AZURE_OPEN_AI_DEPLOYMENT_MODEL= AZURE_OPEN_AI_API_VERSION=
  2. 安装uv进行 Python 库管理
    pip install uv uv sync
  3. 执行python chatgui.py
    • 示例屏幕显示客户端启动浏览器导航到 URL。

相对于‘stdio’

stdio传输层(原始数据流),而JSON-RPC应用协议(结构化通信)。它们之间有区别,但经常互换使用,例如,在协议中,“JSON-RPC over stdio”。

工具描述

@self.mcp.tool() async def playwright_navigate(url: str, timeout=30000, wait_until="load"): """Navigate to a URL.""" -> This comment provides a description, which may be used in a mechanism similar to function calling in LLMs. # Output Tool(name='playwright_navigate', description='Navigate to a URL.', inputSchema={'properties': {'url': {'title': 'Url', 'type': 'string'}, 'timeout': {'default': 30000, 'title': 'timeout', 'type': 'string'}

提示:紫外线

uv run: Run a script. uv venv: Create a new virtual environment. By default, '.venv'. uv add: Add a dependency to a script uv remove: Remove a dependency from a script uv sync: Sync (Install) the project's dependencies with the environment.

提示

  • python.exe 的 taskkill 命令
taskkill /IM python.exe /F
  • 可视化代码:Python 调试器:使用 launch.json 进行调试将使用 .vscode/launch.json 中的配置启动调试器。
-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

利用模型上下文协议 (MCP) 和 Azure OpenAI 的最小服务器/客户端应用程序实现。

  1. 模型上下文协议(MCP)
    1. 官方存储库
    2. 社区资源
    3. 相关项目
    4. MCP剧作家
    5. 配置
    6. 相对于‘stdio’
    7. 工具描述
    8. 提示:紫外线
    9. 提示

Related MCP Servers

  • A
    security
    A
    license
    A
    quality
    A Model Context Protocol (MCP) server that provides JSON-RPC functionality through OpenRPC.
    Last updated -
    2
    7
    33
    JavaScript
    Apache 2.0
    • Apple
  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol (MCP) server that lets you seamlessly use OpenAI's models right from Claude.
    Last updated -
    1
    24
    28
    JavaScript
    MIT License
    • Apple
  • -
    security
    A
    license
    -
    quality
    An MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.
    Last updated -
    2
    Python
    MIT License
  • -
    security
    A
    license
    -
    quality
    A Model Context Protocol (MCP) server implementation for the OpenLedger API. This server provides structured context to AI models according to the MCP specification.
    Last updated -
    8
    TypeScript
    Apache 2.0

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/kimtth/mcp-aoai-web-browsing'

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