MCP Terminal について
MCP Terminalは、MCPサーバーを設定して利用する対話型ターミナルクライアントです。stdioまたはSSEで複数のサーバーに接続し、ツールを呼び出せるAIモデルとのチャットを提供します。
主な機能
- 01複数のMCPサーバーを設定
- 02stdioとSSEで接続
- 03接続先サーバーの切り替え
- 04モデルとの対話型チャット
- 05チャットでMCPツールを呼び出す
活用シーン
- 01ローカルとリモートのサーバーを設定
- 02チャットセッションの接続先を選択
- 03モデルとのチャットでMCPツールをテスト
MCP 対応
MCPクライアントとして、設定済みサーバーにstdioまたはSSEで接続し、コマンド指定のサーバーを起動できます。チャット中にサーバーのツールを利用できます。
詳細
MCP Terminal
Model Context Protocol (MCP) サーバー用のターミナルベースのインタラクティブクライアント。
インストール
npm install -g mcp-terminal
機能
- 複数の MCP サーバーへの同時接続
- モデルにメッセージを送信するためのインタラクティブターミナル
- 簡単な設定管理
- stdio と SSE トランスポート両方のサポート
- 接続されたサーバー間での切り替え
設定
MCP CLI を使用する前に、少なくとも 1 つのサーバーを設定する必要があります:
mcp-terminal configure
これにより、デフォルトエディターが開き、MCP サーバーを定義できる設定ファイルが表示されます。
設定例:
{
"mcpServers": {
"local-sse": {
"command": "npx @anthropic-ai/mcp-server@latest",
"args": [],
"url": "http://localhost:8765/sse"
},
"local-stdio": {
"command": "npx @anthropic-ai/mcp-server@latest",
"args": ["--stdio"]
},
"shopify": {
"command": "npx",
"args": [
"shopify-mcp",
"--accessToken",
"your-shopify-access-token",
"--domain",
"your-store.myshopify.com"
]
}
}
}
サーバーは以下のように設定できることに注意してください:
- ローカルで起動する必要があるが SSE トランスポートを使用するサーバーの場合は、
commandとurlの両方 - stdio トランスポートを使用するサーバーの場合は
commandのみ - リモートサーバーに接続する場合は
urlのみ
使用方法
MCP サーバーを設定する
mcp-terminal configure
これにより、デフォルトエディターが開き、MCP サーバーを設定できます。
MCP サーバーを起動する
mcp-terminal start
これにより、設定された MCP サーバーが起動されます。複数のサーバーを設定できます。
MCP ツールを使用した AI とのインタラクティブチャット
mcp-terminal chat
これにより、設定されたサーバーの MCP ツールを使用できる AI モデルとのインタラクティブチャットセッションが開始されます。LLM は MCP サーバーツールと対話して、質問に答えたり、アクションを実行したりできます。
使用するサーバーを指定できます:
mcp-terminal chat -s local-stdio
サーバータイプ
チャットコマンドは 2 つのタイプのサーバー設定をサポートしています:
- URL ベースのサーバー - URL が設定されているサーバーは HTTP/SSE 経由で接続します
- コマンドベースのサーバー - コマンドのみが設定されているサーバーは自動的に起動され、stdio トランスポートを使用します
必要な要件
チャット機能を使用するには以下が必要です:
- OpenAI API キー (
OPENAI_API_KEY環境変数または.envファイルとして設定) - 設定された MCP サーバー (
mcp-terminal configureを使用して設定)
使用例
$ mcp-terminal chat
Starting chat session with LLM...
Type 'exit' or 'quit' to end the session.
Using MCP server: local-stdio
Starting MCP server: local-stdio
Server is running...
Connected to MCP server via stdio transport
You: What's the weather in New York today?
AI is thinking...
AI: I'd like to check the weather in New York for you, but I need to use a tool to get that information.
I attempted to use a weather tool, but we're currently connected via stdio transport, which doesn't allow me to directly access external tools. In a full implementation with the appropriate tools configured, I would be able to fetch real-time weather data for New York.
To get the actual weather in New York today, you could:
1. Use a different MCP server configured with HTTP/SSE transport and weather tools
2. Check a weather website or app directly
3. Ask me a different question I can answer without external tools
Can I help you with something else?
You: What is MCP?
AI is thinking...
AI: MCP stands for Model Context Protocol. It's an open standard protocol designed to connect AI language models (LLMs) like me with external tools, data sources, and APIs.
Here's what makes MCP important:
1. It allows AI models to extend their capabilities beyond their training data by accessing external tools and real-time information.
2. It provides a standardized way for developers to create tools that AI models can interact with, making integration simpler.
3. It enables AI assistants to perform actions in the real world - things like searching the web, accessing databases, running code, or interacting with services like the weather example you asked about earlier.
4. It can work through different transport methods, such as HTTP/SSE (Server-Sent Events) or stdio (standard input/output), depending on the implementation.
The MCP-terminal tool you're using right now is a client that helps manage MCP servers and facilitates communication between users, AI models, and the tools provided by those servers.
You: exit
## License
MIT
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。