MCP Server with Docker
Docker を使用した MCP サーバー
このプロジェクトは、モデル制御プロトコル (MCP) を OpenAI の API と統合し、OpenAI が Docker で実行されている MCP サーバーによって公開されるツールにアクセスして使用できるようにする方法を示します。
前提条件
システムにDockerがインストールされている
Git(リポジトリのクローンを作成する)
Related MCP server: OpenAI MCP Server
プロジェクト構造
server.py: ツールを使ったMCPサーバ実装client.py: サーバーに接続してエージェントを呼び出すクライアントDockerfile: Dockerイメージを構築するための手順requirements.txt: プロジェクトの Python 依存関係
データフローの説明
ユーザークエリ: ユーザーはシステムにクエリを送信します (例: 「当社の休暇ポリシーは何ですか?」)
OpenAI API : OpenAIはMCPサーバーからクエリと利用可能なツールを受け取ります
ツールの選択: OpenAIはクエリに基づいてどのツールを使用するかを決定します
MCPクライアント:クライアントはOpenAIのツール呼び出し要求を受信し、MCPサーバーに転送します。
MCP サーバー: サーバーは要求されたツールを実行します (例: ナレッジ ベース データの取得)
レスポンスフロー: ツールの結果はMCPクライアントを介してOpenAIに返されます。
最終応答: OpenAIはツールデータを組み込んだ最終応答を生成する
Dockerで実行する
ステップ1: Dockerイメージを構築する
docker build -t mcp-server .ステップ2: Dockerコンテナを実行する
docker run -p 8050:8050 mcp-serverこれにより、Docker コンテナ内で MCP サーバーが起動し、ポート 8050 で公開されます。
クライアントの実行
サーバーが起動したら、別のターミナルでクライアントを実行できます。
python client.pyクライアントはサーバーに接続し、利用可能なツールを一覧表示し、エージェントを呼び出してクエリに応答します。
トラブルシューティング
接続の問題が発生した場合:
サーバーが実行中かどうかを確認します。docker
docker psを使用して Docker コンテナが実行中であることを確認します。ポート マッピングを確認する:
docker psを使用するか、docker runコマンドの出力をチェックして、ポートが正しくマッピングされていることを確認します。サーバー ログを確認する:
docker logs <container_id>を使用してサーバー ログを表示し、エラーがあるかどうかを確認します。ホストバインディング:コンテナ外からアクセスできるようにするため、サーバーは
127.0.0.1ではなく0.0.0.0にバインドするように設定されています。それでも問題が解決しない場合は、ファイアウォールの設定を確認する必要があるかもしれません。ネットワークの問題: リモート マシンで Docker を実行している場合は、クライアント マシンからポートにアクセスできることを確認してください。
注記
サーバーは SSE (Server-Sent Events) トランスポートを使用するように構成されており、ポート 8050 でリッスンします。
クライアントは
http://localhost:8050/sseでサーバーに接続します。クライアントを起動する前に、サーバーが実行中であることを確認してください。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for AI dialogue using various LLM models via AceDataCloud
An MCP server that integrates with Discord to provide AI-powered features.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceA simple MCP server for interacting with OpenAI assistants. This server allows other tools (like Claude Desktop) to create and interact with OpenAI assistants through the Model Context Protocol.939MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server implementation that enables connection between OpenAI APIs and MCP clients for coding assistance with features like CLI interaction, web API integration, and tool-based architecture.35-
- AlicenseNot gradedqualityDmaintenanceA server that integrates the MCP library with OpenAI's API, allowing users to interact with various tools, such as the weather tool, through natural language queries.MIT
- FlicenseNot gradedqualityDmaintenanceAn auto-generated MCP server that enables interaction with the OpenAI API, allowing users to access OpenAI's models and capabilities through the Multi-Agent Conversation Protocol.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/TomasRodriguez2002/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server