Skip to main content
Glama
mgx-thinking-log-mcp

mgx-thinking-log-mcp

by zhiyue
README.md
# mgx-thinking-log-mcp

An MCP (Model Context Protocol) server for downloading and reading MGX thinking logs. Enables AI agents to fetch and analyze MGX conversation logs programmatically.

## Installation

```bash
npm install -g mgx-thinking-log-mcp
```

## Quick Start

### Claude Desktop / Cursor (Team Mode)

Add to your MCP config (`claude_desktop_config.json` or `.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "mgx-thinking-log": {
      "command": "npx",
      "args": ["-y", "mgx-thinking-log-mcp"],
      "env": {
        "MGX_TOKEN": "your-token-here"
      }
    }
  }
}
```

### Claude Code

```bash
claude mcp add mgx-thinking-log -- npx -y mgx-thinking-log-mcp
```

Then set environment variable `MGX_TOKEN` or pass token per-request.

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `MGX_TOKEN` | Auth token (appended as `?token=` to skip Bearer auth) | - |
| `MGX_BASE_URL` | Base URL for the MGX API | `http://test-tool.deepwisdomai.com` |

## Tools

### `get_thinking_logs`

Fetch thinking logs for a chat. Returns log content as text for agent analysis.

**Parameters:**
- `chat_id` (required) - The chat/conversation ID
- `env` (optional) - Environment: `prod`, `alpha`, `pre`, `us-test`, `us-test-2` (default: `prod`)
- `token` (optional) - Auth token, overrides `MGX_TOKEN` env var

**Example prompt:**
> Read the thinking logs for chat `abc123` in prod environment

### `download_thinking_logs`

Download thinking logs to a local file.

**Parameters:**
- `chat_id` (required) - The chat/conversation ID
- `env` (optional) - Environment (default: `prod`)
- `output_path` (required) - Local file path to save logs
- `token` (optional) - Auth token

**Example prompt:**
> Download the logs for chat `abc123` to `/tmp/logs.txt`

### `get_mgx_env`

Fetch the `mgxenv.json` configuration for a specific chat version.

**Parameters:**
- `chat_id` (required) - The chat/conversation ID
- `env` (optional) - Environment (default: `prod`)
- `version` (required) - Version number
- `token` (optional) - Auth token

**Example prompt:**
> Get the mgxenv config for chat `abc123` version `v2`

## Rate Limiting

The upstream API has a global rate limit. Keep concurrent requests under 10 without prior arrangement. For higher concurrency, contact the platform team.

## Development

```bash
git clone <repo-url>
cd mgx-thinking-log-mcp
npm install
npm run build
npm start
```

## License

MIT

TDQS

A4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a distinct operation: fetching log content as text, downloading logs to a file, and retrieving environment config. The difference between get and download is clear—one returns content for analysis, the other persists to disk.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern (get_, download_). The nouns are descriptive and aligned with the tool's function, with no mixed naming conventions.

Tool Count5/5

Three tools is a well-scoped count for a focused logging/configuration server. Each tool serves a distinct purpose and none are redundant or bloat.

Completeness4/5

Core retrieval operations are covered: getting logs, downloading logs, and fetching environment config. A minor gap is the lack of listing or searching available logs, but the tool set likely expects chat IDs as inputs, making the surface adequate.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues