AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Fastchat Mcp

mcp-rb58853-fastchat-mcp · by rb58853

fastchat-mcp is a very simple way to interact with MCP servers using custom chats through natural language.

— No reviews yet
0 installs
47 views
0.0% view→install

Install

$ agentstack add mcp-rb58853-fastchat-mcp

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ● Network access Used
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ● Environment & secrets Used
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-rb58853-fastchat-mcp)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
○ 5mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Fastchat Mcp? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Fastchat MCP

[](https://opensource.org/licenses/MIT) [](https://pypi.org/project/fastchat-mcp) [](https://pepy.tech/projects/fastchat-mcp) [](https://github.com/rb58853/fastchat-mcp/stargazers) [](https://github.com/rb58853/fastchat-mcp/network/members) [](https://github.com/rb58853/fastchat-mcp) [](https://github.com/rb58853/fastchat-mcp/graphs/contributors) [](https://mseep.ai/app/rb58853-fastchat-mcp) [](https://modelcontextprotocol.io/quickstart/client) [](https://github.com/rb58853/fastchat-mcp/commits) [](https://github.com/rb58853/fastchat-mcp/commits) [](https://github.com/rb58853/fastauth-api)

Python chat client, based on mcp[cli], for connecting to MCP servers through multiple protocols, specifically designed to work with integrated language models. Fastchat-mcp is a very simple way to interact with MCP servers using custom chats through natural language.

Table of Contents

  • [Overview](#overview)
  • [Installation](#installation)
  • [LLM Implementation](#llm-implementation)
  • [LLM Providers](#llm-providers)
  • [LLM Models](#llm-models)
  • [Implemented Transfer Protocols](#implemented-transfer-protocols)
  • [System Requirements](#system-requirements)
  • [Configuration](#file-fastchatconfigjson)
  • [Aditional Configuration](#additional-configuration)
  • [API & Websocket Integration](#api--websocket-integration)
  • [Usage Example](#usage-example)
  • [Version History](#version-history)
  • [Project Status](#project-status)
  • [Flow](./doc/FLOW.md)
  • [License](#license)

Overview

This package provides a Python interface to connect to MCP servers in an easy, intuitive, and configurable way. It features a modular architecture that allows for the seamless addition of new transfer protocols and language models (LLM) providers. Currently, it supports the HTTPStream and Stdio transport protocols and uses LiteLLM as the LLM gateway, enabling model usage across multiple providers.

Installation

To install the MCP client, you can use pip:

pip install fastchat-mcp

LLM Implementation

LLM Providers

The client currently supports the following language model gateway:

| Provider | Status | Technical Description | | --- | --- |--- | | LiteLLM | Implemented |LiteLLM provides a unified interface for multiple LLM providers, allowing you to use models from OpenAI, Anthropic, Google, Azure, Bedrock, Groq, and others through a common API.|

>🚨 CONFIGURATION NOTE The runtime provider is LiteLLM, and model/provider selection is controlled by the model identifier and environment variables.

Default Provider (LiteLLM): LiteLLM acts as a unified adapter to route requests to many LLM vendors while preserving a consistent interface in Fastchat.

LLM Models

This project can use any model supported by LiteLLM, providing flexibility to choose the model that best fits your specific needs. To explore providers and model naming conventions, consult the official LiteLLM provider documentation.

To select a model, you should create a chat instance like this:

from fastchat import Fastchat
chat = Fastchat(model="my-model-id", ...)
Supported Model Examples

The following table contains examples of model identifiers that can be passed to the core. Each model must be prefixed with its provider identifier:

| Provider | Model Examples | Use Case | | --- | --- | --- | | OpenAI | gpt-4o, gpt-4-turbo, gpt-5-nano | General purpose, advanced reasoning | | Anthropic | anthropic/claude-3-7-sonnet, anthropic/claude-3-opus | Enterprise, complex reasoning | | Google | gemini/gemini-2.5-pro, gemini/gemini-2-flash-preview, gemini/gemini-3-flash-preview | Multimodal, versatile | | Groq | groq/llama-3.1-8b-instant, groq/llama-3.1-70b-versatile, groq/meta-llama/llama-4-scout-17b-16e-instruct | Fast inference, cost-effective | | Mistral | mistral/mistral-large, mistral/mistral-tiny | Efficient, multilingual | | Meta (Llama) | ollama/llama2, ollama/mistral | Self-hosted, local inference | | Azure | azure/gpt-4-deployment, azure/ | Enterprise, Azure integration | | AWS Bedrock | bedrock/anthropic.claude-3-sonnet, bedrock/meta.llama2-13b | AWS ecosystem |

Usage Examples:

from fastchat import Fastchat

# OpenAI models (requires OPENAI_API_KEY)
chat = Fastchat(model="gpt-4o", ...)

# Groq models (requires GROQ_API_KEY)
chat = Fastchat(model="groq/llama-3.1-70b-versatile", ...)

# Google Gemini models (requires GEMINI_API_KEY)
chat = Fastchat(model="gemini/gemini-2-flash-preview", ...)

# Anthropic Claude models (requires ANTHROPIC_API_KEY)
chat = Fastchat(model="anthropic/claude-3-7-sonnet", ...)

# Mistral models (requires MISTRAL_API_KEY)
chat = Fastchat(model="mistral/mistral-large", ...)

Default Model ("groq/openai/gpt-oss-120b"): The 120B open-source model is a powerful, cost-effective option that provides excellent performance and reasoning capabilities. Served through Groq's fast inference platform, it delivers low-latency responses ideal for production applications. This model combines the strength of a large parameter count with competitive pricing and speed, making it suitable for complex tasks, code generation, and detailed analysis while maintaining cost efficiency.

Implemented Transfer Protocols

Protocols for communication with MCP servers:

| Protocol | Status | Technical Characteristics | | --- | --- | --- | | stdio | Implemented | Standard input/output interface that facilitates direct communication between processes.| | HTTPStream | Implemented | Asynchronous HTTP-based protocol that enables continuous data streaming.| | SSE (Server-Sent Events) | Not Implemented | Unidirectional protocol that allows the server to send multiple updated events through a single HTTP connection.|

>🚨 CRITICAL CONFIGURATION NOTE Currently, this project don't work with SSE (Server-Sent Events) protocol.

System Requirements

Environmental Configuration

  • .env file: The .env file contains the authentication credentials necessary for integration with external services. This file must be created in the project root directory with the following format:

#### Basic Configuration

```env # .env

# Cryptography key for token data storage (OAuth2) CRIPTOGRAFY_KEY= ```

#### LLM Provider API Keys

The following environment variables configure authentication with different LLM providers. Add only the keys for the providers you plan to use:

```env # OpenAI OPENAIAPIKEY=

# Anthropic (Claude) ANTHROPICAPIKEY=

# Google (Gemini) GEMINIAPIKEY=

# Groq GROQAPIKEY=

# Mistral MISTRALAPIKEY=

# Azure OpenAI AZUREAPIKEY= AZUREAPIBASE= AZUREAPIVERSION=

# AWS Bedrock (requires AWS credentials) AWSACCESSKEYID= AWSSECRETACCESSKEY= AWSREGIONNAME=

# Local/Ollama models (if using local inference) OLLAMABASEURL=http://localhost:11434 ```

#### LiteLLM Configuration (Optional)

```env # Set a default routing API key (optional) LITELLMAPIKEY=

# Set a custom base URL (for OpenAI-compatible APIs) LITELLMBASEURL= ```

#### How to Add API Keys

  1. Create a .env file in the project root directory (same level as fastchat.config.json):

``bash touch .env ``

  1. Add the API key for your selected provider:

```env # Example: Using Groq GROQAPIKEY=gskyouractualgroqapikeyhere

# Example: Using Google Gemini GEMINIAPIKEY=youractualgeminiapikey_here ```

  1. The application will automatically load these credentials when initializing the chat:

```python from fastchat import Fastchat

# This will use the GROQAPIKEY from .env chat = Fastchat(model="groq/llama-3.1-70b-versatile", ...) ```

  1. ⚠️ Security Note: Never commit the .env file to version control. Add it to your .gitignore:

``bash echo ".env" >> .gitignore ``

  • fastchat.config.json file: The fastchat.config.json file defines the configuration of available MCP servers. It must be created in the project root directory with this [structure](#file-fastchatconfigjson)

Dependencies

  • Python = ">=3.11"
  • litellm
  • mcp[cli]
  • mcp-oauth

File fastchat.config.json

This file defines the configuration of available MCP servers (Model Context Protocol) in the project. It must be placed in the root directory of the repository. Its main purpose is to inform the application which servers can be used and how to connect to them.

General Structure

The file is JSON formatted and follows this main structure:

{
    "app_name": "fastchat-mcp",
    "mcp_servers": {
    "..."
    }
}
  • app_name: The identifiable name of the application or project using these MCP servers.
  • mcp_servers: An object listing one or more configured MCP servers, each with its unique key.

Server Definition

Each MCP server inside "mcp_servers" has a custom configuration with these common properties:

  • Server key (e.g., "example_public_server", "github", etc.): internal name identifying this server.
  • protocol: Protocol or communication method. It can be:
  • "httpstream": Communication via HTTP streaming.
  • "stdio": Communication based on standard input/output (local command execution).

Server Configuration Examples

1. Public HTTP Stream Server
"example_public_server": {
    "protocol": "httpstream",
    "httpstream-url": "http://127.0.0.1:8000/public-example-server/mcp",
    "name": "example-public-server",
    "description": "Example public server."
}
  • httpstream-url: Base URL where the MCP HTTP streaming server is exposed.
  • No authentication required (public access).
  • "name" and "description" provide descriptive labels for users.
2. Private HTTP Stream Server with Authentication
"example_private_mcp": {
    "protocol": "httpstream",
    "httpstream-url": "http://127.0.0.1:8000/private-example-server/mcp",
    "name": "example-private-server",
    "description": "Example private server with oauth required.",
    "auth": {
        "required": true,
        "post_body": {
            "username": "user",
            "password": "password"
        }
    }
}
  • Adds an "auth" object on top of basic config:
  • required: true indicates authentication is needed.
  • post_body: Data sent for authentication (username and password here).
  • Suitable for servers secured with OAuth2.
3. GitHub Server with Authentication Headers
"github": {
    "protocol": "httpstream",
    "httpstream-url": "https://api.githubcopilot.com/mcp",
    "name": "github",
    "description": "This server specializes in github operations.",
    "headers": {
        "Authorization": "Bearer {your-github-access-token}"
    }
}
  • Uses a custom HTTP header "Authorization" for token-based authentication.
  • Perfect for sending API keys or tokens in headers to access the server.
4. Local Server using STDIO protocol
"my-stdio-server": {
    "protocol": "stdio",
    "name": "my-stdio-server",
    "config": {
        "command": "npx",
        "args": [
            "-y",
            "@modelcontextprotocol/example-stdio-server"
        ]
    }
}
  • Does not use HTTP; communication happens by executing local commands.
  • "config" specifies the command and arguments to run the MCP server. This key value(or body) has the same Claude Desktop sintaxis.
  • Useful for local integrations or development testing without networking.

Database Configuration

Database connection settings are defined in the fastchat.config.file. If the connection is established successfully, the conversation flow will automatically handle sending and retrieving data from the specified endpoints.

{
    "...": "...",

    "db_conection": {
        "root_path": "http://127.0.0.1:6543/fastchatdb",
        "headers": {
            "example_autorization_token": "",
            "other_header": "value",
            "...": "..."
        },
        "base_body": {
            "company_id": "",
            "example_body_param": "",
            "other_body_param": "value",
            "...": "..."
        },
        "base_query": {
            "company_id": "",
            "example_query_param": "",
            "other_query_param": "value",
            "...": "..."
        },
        "endpoints": {
            "save_message": {
                "path": "/message/save"
            },
            "load_history": {
                "path": "/history/load"
            }
        }
    }
}

[See more about database](./doc/DATABASE.md)

Notes

> ⚠️ Place this file in the project root so the application can detect it automatically. > >💡 If you need an httpstream MCP server to test the code, you can use simple-mcp-server. > > ✍️ If you need help configuring a specific server or using this configuration in your code, feel free to open discussion for help!

[see config.example.json](config.example.json)


Additional Configuration

System Prompts

As an advanced configuration, system prompts can be supplied to modify the behavior of responses. Prompts should be provided as lists; multiple system prompts can be supplied.

Args
  • extra_reponse_system_prompts: List of string prompts used as additional system prompts in the final responses.
  • extra_selection_system_prompts: List of string prompts used as additional system prompts for the resource/service selection step exposed by connected MCP servers.

Example:

chat = Fastchat(
    extra_reponse_system_prompts=[
        "You are an NPC street vendor for an RPG game. You must behave as such and respond according to your character. You specialize in selling medieval weaponry, such as swords, armor, shields, and more. Address anyone who speaks to you as if they were an adventurer in a medieval fantasy world."
    ]
)

[See example here](./doc/USAGE.md#customizing-system-prompts)

Additional MCP Servers

In addition to the servers defined in the configuration file, you can pass extra MCP servers via parameters. These are provided as a dictionary with the same structure as the configuration file, under the key "mcp-servers".

Args
  • additional_servers: Additional servers to be supplied to the Fastchat component, following the same format as the configuration file, for example:
my_servers = {
  "github": {
    "protocol": "httpstream",
    "httpstream-url": "https://api.githubcopilot.com/mcp",
    "name": "github",
    "description": "This server specializes in github operations.",
    "headers": {
      "Authorization": "Bearer {your-github-token}"
    }
  },
  "other_server": {"...": "..."}
}
chat = Fastchat(additional_servers=my_servers)

> Note: Servers defined in the .config file are concatenated with those passed as parameters; it is compatible to use both methods to add MCP servers.

> API: The websocket exposed by the API supports additional servers passed through the additional_servers parameter.

Browser-compatible additional servers injection (WebSocket)

Some browser WebSocket clients do not allow custom headers. For this scenario, the API now supports sending additional servers in the first WebSocket message.

How it works:

  1. The API reads aditional_servers from headers (if available).
  2. Optionally, the API reads the first client message and checks whether it is an additional-servers payload.
  3. Final additional servers are the merge of both sources:
  • header-provided servers
  • first-message serve

…

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.