MCP サーバーの例
このプロジェクトは、Cursor やその他のツールで使用できる非常に基本的な MCP サーバーです。
index.ts を変更して必要なツールを追加するか、デフォルトのツールをそのまま使用します。
次にプロジェクトをビルドします。
pnpm run build
そして実行します:
pnpm run start
次に、プロジェクトに .cursor/mcp.json ファイルを追加し、以下を貼り付けます。
{
"mcpServers":{
"weather":{
"command": "node",
"args": ["[path]/build/index.js"]
}
}
}
[path] をこのプロジェクトへの絶対パスに置き換えてください。プロジェクトフォルダで pwd を実行してください。例えば、私の場合は以下のようになります。
{
"mcpServers":{
"weather":{
"command": "node",
"args": ["/Users/ivanbtrujillo/Development/mcp-server-spike/build/index.js"]
}
}
}
カーソルの「設定」に移動してください。MCPサーバーが表示されるはずです。有効化してください(右上をクリック)。
次にチャットに移動し、エージェント モードに切り替えて、モデルとして claude-3.7-sonnet を選択します。
次のように入力します。
What is the weather in Texas?
MCP を使用して、最初に天気警報を取得し、次に予報を取得します。以下は、テキサスの天気を問い合わせるときのチャット インターフェイスの外観の例です。
Cursor と統合して、Claude-3.7-sonnet モデルを使用した天気情報の取得などの AI ツールを有効にできる基本的な MCP サーバー テンプレート。
Related MCP Servers
- AsecurityFlicenseAqualityA starter template for building Model Context Protocol servers that can be integrated with Cursor or Claude Desktop, allowing developers to create custom tools and extensions for AI assistants.Last updated -1314
- -securityFlicense-qualityA simple MCP service that allows users to query weather conditions for cities worldwide through the Cursor AI assistant.Last updated -1
- AsecurityFlicenseAqualityA starter template for building Model Context Protocol servers that integrate with AI assistants like Claude and Cursor, providing custom tools, resource providers, and prompt templates.Last updated -2
- AsecurityFlicenseAqualityA starter template for building Model Context Protocol servers that integrate with AI assistants like Claude and Cursor, providing custom tools, resource providers, and prompt templates.Last updated -2