loading…
Search for a command to run...
loading…
A minimal server/client MCP implementation using Azure OpenAI and Playwright.
A minimal server/client MCP implementation using Azure OpenAI and Playwright.
A minimal server/client application implementation utilizing the Model Context Protocol (MCP) and Azure OpenAI.
FastMCP. Playwright is an an open source, end to end testing framework by Microsoft for testing your modern web applications. MCP-LLM Bridge implementation.client_bridge supports both in-process and external (stdio) MCP server connections, enabling reuse by different clients (e.g., Claude Code, VS Code, custom scripts).Model Context Protocol (MCP) MCP (Model Context Protocol) is an open protocol that enables secure, controlled interactions between AI applications and local or remote resources.
During the development phase in December 2024, the Python project should be initiated with 'uv'. Other dependency management libraries, such as 'pip' and 'poetry', are not yet fully supported by the MCP CLI.
Rename .env.template to .env, then fill in the values in .env for Azure OpenAI:
AZURE_OPEN_AI_ENDPOINT=
AZURE_OPEN_AI_API_KEY=
AZURE_OPEN_AI_DEPLOYMENT_MODEL=
AZURE_OPEN_AI_API_VERSION=
Install uv for python library management
pip install uv
uv sync
Execute python chatgui.py

The MCP server can be used by external clients (Claude Desktop, VS Code, Claude Code, etc.) via mcp.json configuration.
Add to your claude_desktop_config.json (Claude Desktop) or .claude/mcp.json (Claude Code):
{
"mcpServers": {
"browser-navigator": {
"command": "uv",
"args": ["run", "fastmcp", "run", "./server/browser_navigator_server.py:app"],
"cwd": "/path/to/mcp-aoai-web-browsing",
"env": {
"AZURE_OPEN_AI_ENDPOINT": "...",
"AZURE_OPEN_AI_API_KEY": "...",
"AZURE_OPEN_AI_DEPLOYMENT_MODEL": "...",
"AZURE_OPEN_AI_API_VERSION": "..."
}
}
}
}
Add to .vscode/mcp.json in your workspace:
{
"servers": {
"browser-navigator": {
"command": "uv",
"args": ["run", "fastmcp", "run", "./server/browser_navigator_server.py:app"],
"cwd": "${workspaceFolder}",
"env": {
"AZURE_OPEN_AI_ENDPOINT": "...",
"AZURE_OPEN_AI_API_KEY": "...",
"AZURE_OPEN_AI_DEPLOYMENT_MODEL": "...",
"AZURE_OPEN_AI_API_VERSION": "..."
}
}
}
}
The client_bridge also supports connecting to external MCP servers via stdio from Python:
from client_bridge import BridgeConfig, MCPServerConfig, BridgeManager
from client_bridge.llm_config import get_default_llm_config
config = BridgeConfig(
server_config=MCPServerConfig(
command="uv",
args=["run", "fastmcp", "run", "./server/browser_navigator_server.py:app"],
),
llm_config=get_default_llm_config(),
system_prompt="You are a helpful assistant.",
)
async with BridgeManager(config) as bridge:
response = await bridge.process_message("Navigate to https://example.com")
from client_bridge.llm_config import get_openai_llm_config
config = BridgeConfig(
mcp=server,
llm_config=get_openai_llm_config(),
)
Set environment variables:
OPENAI_API_KEY=sk-...
OPENAI_MODEL=gpt-...
For clients that manage their own LLM loop, the bridge exposes tool metadata and direct execution:
async with BridgeManager(config) as bridge:
tools = bridge.get_tools() # OpenAI function calling format
result = await bridge.execute_tool("playwright_navigate", {"url": "https://example.com"})
stdio is a transport layer (raw data flow), while JSON-RPC is an application protocol (structured communication). They are distinct but often used interchangeably, e.g., "JSON-RPC over stdio" in protocols.
@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.
taskkill /IM python.exe /F
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"kimtth-mcp-aoai-web-browsing": {
"command": "npx",
"args": []
}
}
}