Skip to main content

MCP server for ZhipuAI GLM — chat and text embeddings

Project description

glm-mcp

MCP server for ZhipuAI GLM — exposes chat and text embeddings to Claude Code (and any MCP-compatible client) via the OpenAI-compatible API.

Tools

Tool Description
glm_chat Text completion — default model glm-4-flash, pass model= to use any GLM chat model (e.g. glm-5)
glm_embed Text embeddings — default model embedding-3, pass model= to override

Quick Start

Install via uvx (recommended)

uvx glm-mcp

Add to Claude Code

Add to ~/.claude.json:

{
  "mcpServers": {
    "glm-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": ["glm-mcp"],
      "env": {
        "GLM_API_KEY": "your_api_key_here"
      }
    }
  }
}

Get your API key at https://open.bigmodel.cn/.

Run from source

git clone https://github.com/sky-zhang01/glm-mcp
cd glm-mcp
uv sync
GLM_API_KEY=your_key uv run glm-mcp

Environment Variables

Variable Required Default Description
GLM_API_KEY Yes ZhipuAI API key
GLM_BASE_URL No https://open.bigmodel.cn/api/paas/v4/ API endpoint override

Token Usage Logging

Each tool call appends a JSON line to ~/.glm-mcp/usage.jsonl:

{"timestamp": "...", "tool": "glm_chat", "model": "glm-4-flash", "input_tokens": 13, "output_tokens": 15}

Development

uv sync --dev
uv run pytest --cov=glm_mcp --cov-report=term-missing

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glm_mcp-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glm_mcp-0.2.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file glm_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: glm_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for glm_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b8fca2ef62dfd5b3feb1790037f2119b1de6d75bd4ff1cc389c215526611b8b9
MD5 694a78b1e398ae6941cf92b107ab0c7c
BLAKE2b-256 8536a7c9299f1d63c249dfc40c20b57d92e0cc5544422bb26a2e09deb9f05ceb

See more details on using hashes here.

File details

Details for the file glm_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: glm_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for glm_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1de2b178947247d134d889dff0eafd8d387ca55561b67dd9559ff4bc36936300
MD5 da887eb9b1fc4e20737668b41d0414ac
BLAKE2b-256 e1ea5bf75992f5713ff9f4425f355951e69b21948db94d766e3f69c4f49b2018

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page