Chatlog

Provides MCP access to chatlogs across chatrooms with search, analytics, and export capabilities.
  • python

0

GitHub Stars

python

Language

5 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": {
    "yhai3596-mcp-chatlog": {
      "command": "chatlog-mcp",
      "args": [],
      "env": {
        "CHATLOG_API_URL": "http://127.0.0.1:5030",
        "PYTHONIOENCODING": "utf-8",
        "CHATLOG_LOG_LEVEL": "info"
      }
    }
  }
}

You can access and analyze chat logs from multiple platforms through a dedicated MCP server. It lets you list chatrooms and contacts, review recent sessions, and fetch chatlogs with flexible filtering and export options. This makes it easy to build conversational analytics or feed data into Claude Code and other MCP clients.

How to use

Set up and run the MCP server, then connect with an MCP client to perform common tasks. You can list chatrooms and contacts, inspect recent sessions, and retrieve chatlogs for a chosen time range with optional filters such as sender, keyword, and format. Use the client’s built‑in commands to call the four core tools and export results as JSON, text, or CSV.

How to install

Prerequisites: Python 3.10 or higher and a working Python environment.

Step 1. Install the MCP server package from PyPI.

pip install chatlog-mcp-server

Step 2. Create the MCP server configuration file at the path you will use for MCP discovery, for example a file named mcp-servers.json with the following content.

{
  "mcpServers": {
    "chatlog": {
      "command": "chatlog-mcp",
      "args": [],
      "env": {
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}

Step 3. Run the MCP server through your MCP client or the shell that can launch the configured command. The server entry named chatlog uses the stdio interface and will start with the provided command and arguments.

Configuration and usage notes

Environment variables you may configure include the API URL the server exposes and the logging level.

  • CHATLOG_API_URL: HTTP API server URL (default: http://127.0.0.1:5030)
  • CHATLOG_LOG_LEVEL: Logging level (default: info)

You can override these in the env section of the MCP server config or export them in your shell before launching the MCP process.

To customize runtime behavior, you can add additional CLI options to the args array in the MCP server configuration as needed by your environment.

Examples of common workflows

List chatrooms with an optional keyword and request JSON output.

# In your MCP client or shell, call the list_chatrooms tool
Use chatlog to list chatrooms with keyword "AI" format json

Get recent sessions and export as JSON for analysis.

Use chatlog to get recent sessions format json

Retrieve chatlogs for a specific time range and talker, then export as JSON for downstream processing.

Use chatlog to get chatlogs with these parameters:
{
  "time": "2026-01-13",
  "talker": "123456789@chatroom",
  "format": "json"
}

Troubleshooting

Common issues include the MCP server not starting, incorrect configuration paths, or network connectivity problems between the MCP client and the API URL. Ensure the MCP process is running and that the mcp-servers.json configuration is correctly accessible by your client. If you see encoding-related errors, set PYTHONIOENCODING=utf-8 in your environment.

Development and testing

Development dependencies can be installed for contributing or running tests locally. Use the development extras when installing the package.

# Install with development dependencies
pip install -e ".[dev]"

Run the test suite to verify changes.

pytest

Available tools

list_chatrooms

Lists chatrooms with an optional keyword filter and output format (json or text).

list_contacts

Lists contacts with an optional keyword filter and output format (json or text).

get_recent_sessions

Returns a list of recently active sessions with an optional output format.

get_chatlog

Fetches chat logs for a given time range and talker with optional sender, keyword, and format filters; supports pagination via limit and offset.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational