2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

各ツールのMCP設定をYAMLで管理する

Posted at

この記事は人間が書きました。

はじめに

私は普段、Amazon Q Developer CLI、Gemini CLI、Claude Code などを日常的に利用しています。複数のツールを使っていると「どのツールにどの MCP を設定してたっけ?」となることが多々あるので、YAMLファイルで一元管理できるツールを作りました。

使い方

使い方は超絶シンプルです。

Homebrewでインストールして初回起動すると、実行したディレクトリ直下にservers.yamlが生成されます。このファイルにはグローバルのMCP設定パスが書かれているので、必要に合わせて修正してください。

# インストール
brew install takayanagishinnosuke/tap/mcpyammy

# 起動
mcpyammy

生成されるservers.yaml

servers.yaml
clients:
  amazonq:
    path: .aws/amazonq/mcp.json
    servers:
  gemini:
    path: .gemini/settings.json
    servers:
  claude:
    path: .claude.json
    servers:

最初に、既存のMCP設定をYAMLに取り込みます。
Importを選択し、確認が出るのでYESを押せば取り込みが完了します。

APIキーやトークンなどが記載されている場合はYAMLファイルを外部公開しないように注意してください

1.png

2.png

MCP設定を追加する場合は、YAMLに追記します。

ここではGemini CLIにContext7 MCPサーバーを追加します。

servers.yaml
clients:
  amazonq:
    path: .aws/amazonq/mcp.json
    servers:
    ....(省略)
   
  gemini:
    path: .gemini/settings.json
    servers:
    - name: playwright
      command: npx
      args:
      - "@playwright/mcp@latest"
    - name: aws-knowledge-mcp-server
      command: uvx
      args:
      - mcp-proxy
      - --transport
      - streamablehttp
      - https://knowledge-mcp.global.api.aws
    - name: awslabs.aws-documentation-mcp-server
      command: uvx
      args:
      - awslabs.aws-documentation-mcp-server@latest
      env:
        FASTMCP_LOG_LEVEL: ERROR
+   - name: context7
+     command: npx
+     args:
+     - -y
+     - "@upstash/context7-mcp"

そしてApplyを選択し...
3.png

context7を追加しても良いか聞いてくるので、YESを選択します。
4.png

完了後は、Gemini CLIの設定ファイルにContext7のMCPが追加されています。

.gemini/settings.json
{
  "mcpServers": {
    "aws-knowledge-mcp-server": {
      "args": [
        "mcp-proxy",
        "--transport",
        "streamablehttp",
        "https://knowledge-mcp.global.api.aws"
      ],
      "command": "uvx"
    },
    "awslabs.aws-documentation-mcp-server": {
      "args": [
        "awslabs.aws-documentation-mcp-server@latest"
      ],
      "command": "uvx",
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR"
      }
    },
+    "context7": {
+      "args": [
+        "-y",
+        "@upstash/context7-mcp"
+      ],
+      "command": "npx"
+    },
   ...(以下略)
}

Gemini CLIを起動して確認もできました。

 ███            █████████  ██████████ ██████   ██████ █████ ██████   █████ █████
░░░███         ███░░░░░███░░███░░░░░█░░██████ ██████ ░░███ ░░██████ ░░███ ░░███
  ░░░███      ███     ░░░  ░███  █ ░  ░███░█████░███  ░███  ░███░███ ░███  ░███
    ░░░███   ░███          ░██████    ░███░░███ ░███  ░███  ░███░░███░███  ░███
     ███░    ░███    █████ ░███░░█    ░███ ░░░  ░███  ░███  ░███ ░░██████  ░███
   ███░      ░░███  ░░███  ░███ ░   █ ░███      ░███  ░███  ░███  ░░█████  ░███
 ███░         ░░█████████  ██████████ █████     █████ █████ █████  ░░█████ █████
░░░            ░░░░░░░░░  ░░░░░░░░░░ ░░░░░     ░░░░░ ░░░░░ ░░░░░    ░░░░░ ░░░░░


Tips for getting started:
1. Ask questions, edit files, or run commands.
2. Be specific for the best results.
3. Create GEMINI.md files to customize your interactions with Gemini.
4. /help for more information.


> /mcp


ℹ Configured MCP servers:
 
  🟢 aws-knowledge-mcp-server - Ready (3 tools)
    - aws___read_documentation
    - aws___recommend
    - aws___search_documentation

  🟢 awslabs.aws-documentation-mcp-server - Ready (3 tools)
    - read_documentation
    - search_documentation
    - recommend

  🟢 context7 - Ready (2 tools)
    - resolve-library-id
    - get-library-docs

さいごに

という...これだけの小さなツールなのですが、個人的には便利です🙌
もし同じ悩みを持ってる方がいればと思い、記事を書いてみました。よければ使ってみて頂けたらと思います。

2
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?