💡
忙しい人のためのMCPまとめ
ざっくりMCPとは何か?
MCPはLLMが使う道具の標準規格
MCPは何の略ですか?
Model Context Protocol
MCPは誰が考えたものですか?
2024年末にAnthropic社が発表
参考
ざっくり作り方を知りたいです
システム構成図
参考
実際のコードイメージ
src/index.ts
// import文など
// 初期設定
const server = new McpServer({
name: "weather",
version: "1.0.0",
capabilities: {
resources: {},
tools: {},
},
});
// 実際にできることを書く
server.tool(
"get-forecast",
"Get weather forecast for a location",
{
latitude: z.number().min(-90).max(90).describe("Latitude of the location"),
longitude: z.number().min(-180).max(180).describe("Longitude of the location"),
},
async ({ latitude, longitude }) => {
};
);
server.tool()は
第一引数:ツールの名前
第二引数:ツールの説明
第三引数:リクエスト内容
第四引数:具体的な処理
参考
実際のClaudeの画面
実際にツールが読み込まれている様子
実際にツールを利用して見た様子
おすすめのZenn
もう少し時間がある人におすすめ
デザインとの連携に興味がある人におすすめ
クリプトに興味がある人におすすめ
Discussion