Skip to main content
Glama

与 Claude 一起使用

https://github.com/user-attachments/assets/731621d7-0acf-4045-bacc-7b34a7d83648

安装选项

预构建 NPM

Github 预构建

从源码构建

Claude 设置

手动

手动

手动

前置条件

Node.js

无

Golang

预构建 NPM

该包发布了一个 mcp-nomad CLI。这是最简单的零安装选项(下载到 npm 缓存;需要 Node/npm):

npx -y @kocierik/mcp-nomad

或者全局安装,以便 mcp-nomad 位于你的 PATH 中:

npm install -g @kocierik/mcp-nomad

使用 npx 的 claude_desktop_config.json(推荐):

{
  "mcpServers": {
    "mcp_nomad": {
      "command": "npx",
      "args": ["-y", "@kocierik/mcp-nomad"],
      "env": {
        "NOMAD_TOKEN": "${NOMAD_TOKEN}",
        "NOMAD_ADDR": "${NOMAD_ADDR}"
      }
    }
  }
}

如果你使用了 npm install -g,请直接将 command / args 设置为二进制文件:

{
  "mcpServers": {
    "mcp_nomad": {
      "command": "mcp-nomad",
      "args": [],
      "env": {
        "NOMAD_TOKEN": "${NOMAD_TOKEN}",
        "NOMAD_ADDR": "${NOMAD_ADDR}"
      }
    }
  }
}

从 GitHub Releases 安装

下载二进制文件并按如下方式配置 Claude Desktop:

{
  "mcpServers": {
    "mcp_nomad": {
      "command": "mcp-nomad",
      "args": [],
      "env": {
        "NOMAD_TOKEN": "${NOMAD_TOKEN}",
        "NOMAD_ADDR": "${NOMAD_ADDR}"
      }
    }
  }
}

从源码构建

go get github.com/kocierik/mcp-nomad
go install github.com/kocierik/mcp-nomad

Related MCP server: @profullstack/mcp-server

服务器选项

命令行标志(在将 MCP Inspector 与手动启动的二进制文件配对时也适用):

  -nomad-addr string
    	Nomad server address (default "http://localhost:4646")
  -port string
    	Port for HTTP server (default "8080")
  -transport string
    	Transport type (stdio, sse, or streamable-http) (default "stdio")

环境变量

  • NOMAD_ADDR: Nomad HTTP API 地址(默认:http://localhost:4646)

  • NOMAD_TOKEN: Nomad ACL 令牌(可选)

  • NOMAD_REGION: 当调用者未覆盖时,作为 REST region 查询参数转发(多区域集群)

  • NOMAD_NAMESPACE: 对于接受可选命名空间的工具,当工具省略该参数时的默认命名空间

  • TLS: NOMAD_CACERT, NOMAD_SKIP_VERIFY, NOMAD_TLS_SERVER_NAME (参见 utils/client.go / buildTLSConfig)

HTTP 客户端遵循官方 /v1/ API,并分布在 utils/client_*.go 中;MCP 工具依赖于 utils/nomad_tool_interfaces.go 中的窄接口。

NomadClient.MakeRequest(仅用于少数集群/遗留调用点)会拒绝内部允许列表之外的路径 — 请优先使用类型化的辅助函数,例如 StopAllocation。

使用 MCP Inspector 浏览

将其用于 本地测试和调试 — 日常使用 Claude Desktop 时不需要。

要在 MCP Inspector 下运行最新发布的 npm 构建版本:

npx @modelcontextprotocol/inspector npx @kocierik/mcp-nomad

带本地 HTTP 服务器的 Inspector(可选)

默认传输方式是 stdio。要将 Inspector 作为 Streamable HTTP 附加,请先在另一个终端中启动二进制文件:

go run . -transport=streamable-http -port=8080

然后在 Inspector 中打开 http://localhost:8080/mcp。对于 -transport=sse,请使用 http://localhost:8080/sse。

许可证

本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An implementation of the Model Context Protocol (MCP) server that enables multiple clients to connect simultaneously and handles basic context management and messaging with an extendable architecture.
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    A basic Model Context Protocol (MCP) server implementation that provides a foundation for MCP server development. The README doesn't specify particular functionality, suggesting it may be a template or starting point for building custom MCP servers.
    1
    -