Content
# NovartcMcp
`NovartcMcp` is a dedicated MCP server for the `NovaRTC` project.
It unifies the project's HTTP interfaces, environment diagnostics, MySQL UTC checking, and WebSocket + protobuf real-time messaging capabilities, exposing them to MCP-enabled clients like Codex. This allows AI to directly participate in project debugging, joint debugging, and troubleshooting.
## Features
- HTTP API tooling: login, contacts, sessions, history messages, read status
- Environment diagnostics: checking HTTP, IM, Redis, MongoDB, MySQL, RocketMQ dependency status
- Configuration reading: directly parsing `application-dev.yml`
- MySQL UTC verification: ensuring database connections and session timezones work under UTC
- MongoDB message querying: querying standardized messages or raw documents by `messageId`
- Persistence tail checking: viewing recently written message records
- Real-time message bridging: sending single-chat/group-chat text messages via WebSocket `/ws` + protobuf
- Short-term subscription: authenticated, time-limited listening to real-time messages
- Codex integration: supporting registration as an MCP server via `~/.codex/config.toml`
## Use Cases
`NovartcMcp` is suitable for the following scenarios:
- Verifying if the `NovaRTC` local environment is fully started
- Allowing Codex to directly log in to the system and query contacts, sessions, and history messages
- Verifying if the message chain from `U1001 -> U1002` can be sent in real-time and successfully stored
- Checking if MySQL strictly connects under UTC to avoid time confusion
- Directly verifying message writing to the underlying collection via MongoDB
- Short-term subscription to WebSocket messages to assist in troubleshooting real-time link issues
- Serving as the AI debugging entry and operation and maintenance entry for the `NovaRTC` project
## Project Layout
```text
D:\NovaRTC\NovartcMcp
├─ server.js
├─ package.json
├─ yarn.lock
├─ README.md
├─ MCP-使用手册.md
├─ MCP-工具参数速查表.md
├─ MCP-联调验证案例.md
└─ MCP-故障排查手册.md
```
## Requirements
- Node.js 18+
- Yarn 1.x
- Accessible NovaRTC local services:
- HTTP API: `http://127.0.0.1:7000/api`
- WebSocket: `ws://127.0.0.1:9688/ws`
- Accessible dependency services:
- MySQL: `127.0.0.1:3307`
- Redis: `127.0.0.1:6379`
- MongoDB: `127.0.0.1:27017`
- RocketMQ: `127.0.0.1:9876`
## Installation
```powershell
cd D:\NovaRTC\NovartcMcp
yarn install
```
## Run
```powershell
cd D:\NovaRTC\NovartcMcp
node server.js
```
Description:
`NovartcMcp` runs in `stdio` mode, not listening to an additional HTTP port.
It communicates with MCP clients through standard input and output.
## Codex Integration
Codex configuration file path:
- `C:\Users\tangj\.codex\config.toml`
Recommended configuration:
```toml
[mcp_servers.novartc]
command = "node"
args = ["D:\\NovaRTC\\NovartcMcp\\server.js"]
[mcp_servers.novartc.env]
NOVARTC_API_BASE_URL = "http://127.0.0.1:7000/api"
NOVARTC_WS_URL = "ws://127.0.0.1:9688/ws"
```
Please restart Codex after modifying the configuration.
## Available Tools
Currently implemented tools:
- `novartc_health_check`
- `novartc_connection_profile`
- `novartc_server_config`
- `novartc_check_dependencies`
- `novartc_mysql_utc_check`
- `novartc_get_user_presence`
- `novartc_login`
- `novartc_list_contacts`
- `novartc_start_chat`
- `novartc_list_chats`
- `novartc_get_chat_history`
- `novartc_mark_chat_read`
- `novartc_send_text_message`
- `novartc_send_group_text_message`
- `novartc_send_ping`
- `novartc_realtime_subscribe`
- `novartc_query_message_by_id`
- `novartc_query_mongo_message_raw`
- `novartc_tail_message_persistence`
## Documentation
### 1. User Manual
File: `D:\NovaRTC\NovartcMcp\MCP-使用手册.md`
### 2. Tool Parameter Quick Reference
File: `D:\NovaRTC\NovartcMcp\MCP-工具参数速查表.md`
### 3. Joint Debugging Verification Cases
File: `D:\NovaRTC\NovartcMcp\MCP-联调验证案例.md`
### 4. Troubleshooting Manual
File: `D:\NovaRTC\NovartcMcp\MCP-故障排查手册.md`
## Recommended Reading Order
For first-time users, it is recommended to read in the following order:
1. `MCP-使用手册.md`
2. `MCP-工具参数速查表.md`
3. `MCP-联调验证案例.md`
4. `MCP-故障排查手册.md`
## Verified Capabilities
Currently verified capabilities include:
- `novartc_login`
- `novartc_list_contacts`
- `novartc_start_chat`
- `novartc_mysql_utc_check`
- `novartc_send_text_message`
- `novartc_get_chat_history`
## Current Limitations
Current limitations:
- Real-time subscription is time-limited listening, not long-term background sessions
- Group chat sending requires explicitly providing `chatId` and `groupId`
- Image/file real-time sending is not yet bridged
- Server log real-time streaming tools are not yet provided
## Roadmap
Future suggested extensions:
- `novartc_send_group_image_message`
- `novartc_query_online_users`
- `novartc_tail_server_log`
- `novartc_realtime_subscribe_presence`
- `novartc_query_group_profile`
## Why MCP Matters For This Project
In the `NovaRTC` project, MCP's value lies in three points:
- Unified debugging entry: integrating HTTP, WebSocket, MySQL, Redis, MongoDB, and RocketMQ into an AI-callable entry
- Reduced joint debugging cost: minimizing repetitive operations like manual token splicing, WebSocket connection, protobuf composition, history querying, and configuration checking
- Improved troubleshooting efficiency: enabling Codex to not only interpret code but also directly participate in project verification and issue localization
`NovartcMcp` aims to become the AI debugging and operation and maintenance platform for `NovaRTC`, not to replace business systems.