Metadata-Version: 2.5
Name: jh-mes-mcp
Version: 1.0.0
Summary: JH-MES MCP Gateway Bridge - STDIO to HTTP
License: MIT
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp>=1.0.0
Description-Content-Type: text/markdown

# JH-MES MCP Gateway Bridge

JH-MES MCP 网关的 STDIO 桥接服务，将标准 MCP STDIO 协议转发到 HTTP 网关。

## 快速开始

### 安装

```bash
pip install jh-mes-mcp
```

### 本地使用

```bash
# 默认连接线上网关
jh-mes-mcp

# 指定网关地址
JH_MES_GATEWAY_URL=http://localhost:9093/mcp-gateway/mcp jh-mes-mcp
```

### MCP 客户端配置

**Cursor / Cherry Studio / VS Code**：

```json
{
  "mcpServers": {
    "jh-mes": {
      "command": "uvx",
      "args": ["jh-mes-mcp"],
      "env": {
        "JH_MES_GATEWAY_URL": "http://mom.azk168.cn/mcp-gateway/mcp"
      }
    }
  }
}
```

**Claude Desktop**（`~/.claude/claude_desktop_config.json`）：

```json
{
  "mcpServers": {
    "jh-mes": {
      "command": "uvx",
      "args": ["jh-mes-mcp"],
      "env": {
        "JH_MES_GATEWAY_URL": "http://mom.azk168.cn/mcp-gateway/mcp"
      }
    }
  }
}
```

## 发布到 PyPI

```bash
# 1. 安装构建工具
pip install build twine

# 2. 构建包
cd mcp-bridge
python -m build

# 3. 上传到 PyPI
twine upload dist/*

# 或使用 TestPyPI 测试
twine upload --repository testpypi dist/*
```

## 魔搭 MCP 广场托管部署

1. 先发布到 PyPI（步骤见上方）
2. 登录 [魔搭 MCP 广场](https://modelscope.cn/mcp)
3. 点击「创建 MCP」→ 选择「可托管部署」
4. 填写配置：
   - **名称**：jh-mes-mcp
   - **安装命令**：`uvx jh-mes-mcp`
   - **环境变量**：`JH_MES_GATEWAY_URL=http://mom.azk168.cn/mcp-gateway/mcp`
5. 提交审核

## 环境变量

| 变量 | 默认值 | 说明 |
|---|---|---|
| `JH_MES_GATEWAY_URL` | `http://mom.azk168.cn/mcp-gateway/mcp` | MCP 网关地址 |
| `JH_MES_TIMEOUT` | `30` | HTTP 请求超时（秒） |

## 架构

```
AI客户端 (Cursor/Cherry Studio/魔搭MCP广场)
    │
    │ STDIO (JSON-RPC over stdin/stdout)
    ▼
jh-mes-mcp (Python 桥接包)
    │
    │ HTTP POST (Streamable HTTP)
    ▼
http://mom.azk168.cn/mcp-gateway/mcp (Java MCP 网关)
    │
    │ RestTemplate
    ▼
jhmes:9090 / jerp:9091 (业务服务)
```
