2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Claude CodeでMCPサーバー使うより、curlコマンド書いた方が楽じゃない?と思ってた話

Posted at

「curlでよくない?」という疑問

Claude Codeを触り始めて思ったのが、「結局API叩くなら、普通にcurlコマンド書いた方がわかりやすくない?」ということ。

# これで済むのに...
curl -X POST https://slack.com/api/chat.postMessage \
  -H "Authorization: Bearer xoxb-..." \
  -d '{"channel":"C123","text":"Hello"}'

なんでわざわざMCPサーバーなんて仕組みが必要なの?自分なりに調べてまとめてみました。

MCPとは

AIアプリケーションと外部ツールを繋ぐ標準プロトコル

開発者 → Claude Code → MCPサーバー(ローカル) → 外部API

MCPサーバーはあなたのPC上で動くNode.jsプロセスです。

curlと比較して気づいたこと

雑に確認する時はcurlの方が楽

curl

curl -X POST https://slack.com/api/chat.postMessage ...

→ 即座に実行、仕組みも理解しやすい

MCP

# Slackアプリ作成、トークン取得、設定など
claude mcp add-json "slack" '{"command":"npx",...}'

→ 初期設定が面倒

でも保守はMCPの方が楽

curlの場合:

# Slack APIが変更されたら、全部のスクリプトを書き換える必要が出てくる
curl -X POST https://slack.com/api/v2/chat.postMessage \  # ← URL変更
  -H "Authorization: Bearer xoxb-..." \
  -d '{"channel":"C123","text":"Hello","blocks":[...]}'  # ← 新パラメータ

MCPの場合:

# これだけ。MCPサーバーが吸収してくれる
npm update @modelcontextprotocol/server-slack

もしMCPがなかったら

新しいサービス対応するには...
├─ MCPなし: Claude Code本体を改修 → 全体を再配布
└─ MCPあり: MCPサーバー追加 → `claude mcp add` だけ

Slack、GitHub、DB、Google Drive...全部Claude Codeに組み込むと、本体が肥大化して保守不可能に。

使い分け

curl MCP
ワンショット確認 ⭕ 即座に実行 ❌ 設定が面倒
継続的な運用 ❌ 保守が大変 ⭕ アップデートだけ

まとめ

「curlでいいじゃん」と思っていましたが、
保守する工数を考えると、MCPサーバーを使った時の方が

初期設定の手間と、長期的な保守性のトレードオフですね。

間違いや補足があればご指摘いただけると嬉しいです!

参考

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?