MCP Web Chat Server

基于MCP的WebChat
  • python

2

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "loli0123456789-mcpwebchat": {
      "command": "python",
      "args": [
        "mcp_server/common_server.py"
      ],
      "env": {
        "AMAP_MCP_KEY": "YOUR_MAP_KEY",
        "MODEL_API_KEY": "YOUR_MODEL_API_KEY"
      }
    }
  }
}

You can run an MCP Web Chat system that connects with MCP servers to provide reliable web-based chat capabilities. This setup includes a common MCP server for shared tooling and a separate business MCP server for wrapping business APIs, ensuring long-running connections stay stable and scalable.

How to use

You interact with the MCP Web Chat by starting the two MCP servers and then running the main application. The common MCP server provides shared services, while the business MCP server wraps specific business APIs. Start each component in the proper order, then launch the main chat application so clients can send and receive messages through the MCP layer.

How to install

Prerequisites: you need Python installed (tested with Python 3.12) and a shell environment. If you use a Python virtual environment, you can create and activate it as shown below.

conda create -n mcp python=3.12
conda activate mcp
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

Additional setup steps

Configure environment variables as needed for your large model API key and map service key. These keys are required for the main program and ensure the MCP servers can access external services.

Start the two MCP servers, then the main application, in the following recommended order.

Run flow and startup sequence

First launch the test API to simulate the external API surface, then start the business MCP server, followed by the common MCP server, and finally start the main program.

# Run test API (simulated business surface)
python mcp_server/test_api.py

# Start business MCP server
python mcp_server/business_server.py

# Start common MCP server
python mcp_server/common_server.py

# Start the main MCP-enabled chat application (the web chat UI / backend)
python app.py

Operational notes

  • The main program listens on port 10001. The simulated API runs on port 10002. The MCP servers listen on ports 9001 (common) and 9002 (business). Make sure these ports are open in your environment.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational