😎

CircleCI 用 MCP Server を試してみる

に公開

時代はMCP。とにかくみんなMCP。それぐらい使いやすい技術で玉石混合の中でベストプラクティスが生まれ、さらに進化していくので、積極的に目についたものは試していくのがいいですよね、と思っています。

ということで最近触っているCircleCIがリリースした純正MCPサーバをついて試していきます。いちいちログインしなくても最近のDeploy状況などが確認できます。

https://github.com/CircleCI-Public/mcp-server-circleci
コードはこちら。
Cursor,VS Code,Claude Desktop,Windsurf用のconfigがおかれていますが、MCPはそもそも汎用プロトコルであることが売りなので、MCPサーバに対応しているものであればどれでも動作するはずです。

さっそくやってみる

MCPホスト環境はClaude Desktopを使いました。
https://zenn.dev/kameoncloud/articles/7b663daf3c4fad
まずはこちらを行ってMCP Serverが起動する環境であることまでを確認しておきます。

0.API Key の発行

CircleCIのマネージメントコンソール右上をクリックしてUser Settingsを選択します。

Create New TokenをクリックしAPIトークンを手元にコピーしておきます。

1.git clone と設定ファイル修正

git clone https://github.com/CircleCI-Public/mcp-server-circleci.git
cd mcp-server-circleci

依存関係を持つライブラリをインストールしてビルドしておきます。

npm install
npm run build
package.json
{
  "name": "mcp-server",
  "module": "src/index.ts",
  "type": "module",
  "version": "1.0.0",
  "description": "Model Context Protocol (MCP) Server",
  "private": true,
  "scripts": {
    "start": "bun run src/index.ts",
    "build": "bun build src/index.ts --outdir build --target node",
    "build:http": "bun build src/server/http-server.ts --outdir build --target node",
    "dev": "bun --watch src/index.ts",
    "start:http": "bun run src/server/http-server.ts",
    "dev:http": "bun --watch src/server/http-server.ts"
  },
  "devDependencies": {
    "@types/bun": "latest",
    "@types/cors": "^2.8.17",
    "@types/node": "^20.11.0"
  },
  "peerDependencies": {
    "@valibot/to-json-schema": "^1.0.0",
    "effect": "^3.14.4",
    "typescript": "^5.8.2"
  },
  "dependencies": {
    "bun": "^1.2.11",
    "cors": "^2.8.5",
    "fastmcp": "^1.21.0",
    "zod": "^3.24.2"
  }
}

私はWindowsで作業を行っているためこのままではbunが実行できないためインストールしておきます。npm installの時点で同時に入っている可能性もありますが環境依存ということで。

Invoke-WebRequest https://bun.sh/install.ps1 -UseBasicParsing | Invoke-Expression
(PowerShellで実行)

では次にClaude Desktopの設定ファイルを以下に修正します。

claude_desktop_config.json
{
  "mcpServers": {
    "circleci": {
      "command": "node",
      "args": ["C:\\Users\\h.kameda\\ccimcp\\mcp-server-circleci\\dist\\index.js"],
      "env": {
        "CIRCLECI_TOKEN": "あなたのCircleCIパーソナルアクセストークン"
      }
    }
  }
}

Windowsの場合、argsのパス指定は\\となりますので注意してください。

2.Claude Desktopの起動とテスト

質問をすると無事動作しました!

CircleCIマネージメントコンソールのProjectPipelinesをクリックした後のブラウザのURLを質問に使うことでDeploy履歴の確認も可能です。


おそらく一番便利なのは失敗したワークフローから、その原因と修正方法の推察ではないでしょうか。


その他の使い方はこちらのREADMEから!
https://github.com/CircleCI-Public/mcp-server-circleci

Discussion