Skip to main content
Glama
hideya

Model Context Protocol (MCP) Server

by hideya

Simple MCP Client to Explore MCP Servers License: MIT pypi version

Quickly test and explore MCP servers from the command line!

Project Status

This utility is based on langchain-mcp-tools, which currently supports MCP Protocol version 2025-03-26.

It does not support the MCP 2026-07-28 specification.

Related MCP server: Just Prompt

Introduction

A simple, text-based CLI client for Model Context Protocol (MCP) servers built with LangChain and Python.
Suitable for testing MCP servers, exploring their capabilities, and prototyping integrations.

Internally it uses LangChain Agent and a utility function convert_mcp_to_langchain_tools() from langchain_mcp_tools.

A TypeScript equivalent of this utility is available here

Prerequisites

Quick Start

  • Install mcp-chat tool. This can take up to a few minutes to complete:

    pip install mcp-chat
  • Configure LLM and MCP Servers settings via the configuration file, llm_mcp_config.json5

    code llm_mcp_config.json5

    The following is a simple configuration for quick testing:

    {
      "llm": {
        "provider": "openai",       "model": "gpt-5.4-mini"
        // "provider": "anthropic",    "model": "claude-haiku-4-5"
        // "provider": "google_genai", "model": "gemini-2.5-flash"
        // "provider": "xai",          "model": "grok-4-1-fast-non-reasoning"
        // "provider": "cerebras",     "model": "gpt-oss-120b"
        // "provider": "groq",         "model": "openai/gpt-oss-20b"
      },
    
      "mcp_servers": {
        "us-weather": {  // US weather only
          "command": "npx", 
          "args": ["-y", "@h1deya/mcp-server-weather"]
        },
      },
    
      "example_queries": [
        "Tell me how LLMs work in a few sentences",
        "Are there any weather alerts in California?",
      ],
    }
  • Set up API keys

    echo "ANTHROPIC_API_KEY=sk-ant-...
    OPENAI_API_KEY=sk-proj-...
    GOOGLE_API_KEY=AI...
    XAI_API_KEY=xai-...
    CEREBRAS_API_KEY=csk-...
    GROQ_API_KEY=gsk_..." > .env
    
    code .env
  • Run the tool

    mcp-chat

    By default, it reads the configuration file, llm_mcp_config.json5, from the current directory.
    Then, it applies the environment variables specified in the .env file, as well as the ones that are already defined.

Features

  • Easy setup: Works out of the box with popular MCP servers

  • Flexible configuration: JSON5 config with environment variable support

  • Multiple LLM/API providers: OpenAI, Anthropic, Google (GenAI), xAI, Ceberas, Groq

  • Command & URL servers: Support for both local and remote MCP servers

  • Local MCP Server logging: Save stdio MCP server logs with customizable log directory

  • Interactive testing: Example queries for the convenience of repeated testing

Limitations

  • Tool Return Types: Currently, only text results of tool calls are supported. It uses LangChain's response_format: 'content' (the default) internally, which only supports text strings. While MCP tools can return multiple content types (text, images, etc.), this library currently filters and uses only text content.

  • MCP Features: Only MCP Tools are supported. Other MCP features like Resources, Prompts, and Sampling are not implemented.

Usage

Basic Usage

mcp-chat

By default, it reads the configuration file, llm_mcp_config.json5, from the current directory.
Then, it applies the environment variables specified in the .env file, as well as the ones that are already defined.
It outputs local MCP server logs to the current directory.

With Options

# Specify the config file to use
mcp-chat --config my-config.json5

# Store local (stdio) MCP server logs in specific directory
mcp-chat --log-dir ./logs

# Enable verbose logging
mcp-chat --verbose

# Show help
mcp-chat --help

Supported Model/API Providers

  • OpenAI: gpt-5.4-mini, gpt-5.2, etc.

  • Anthropic: claude-sonnet-4-6, claude-haiku-4-5, etc.

  • Google (GenAI): gemini-3.1-flash-lite-preview, gemini-2.5-flash, etc.

  • xAI: grok-4-1-fast-non-reasoning, grok-3-mini, etc.

  • Cerebras: gpt-oss-120b, etc.

  • Groq: openai/gpt-oss-20b, openai/gpt-oss-120b, etc.

Configuration

Create a llm_mcp_config.json5 file:

  • The configuration file format for MCP servers follows the same structure as Claude for Desktop, with one difference: the key name mcpServers has been changed to mcp_servers to follow the snake_case convention commonly used in JSON configuration files.

  • The file format is JSON5, where comments and trailing commas are allowed.

  • The format is further extended to replace ${...} notations with the values of corresponding environment variables.

  • Keep all the credentials and private info in the .env file and refer to them with ${...} notation as needed

{
  "llm": {
    "provider": "openai",       "model": "gpt-5.4-mini"
    // "provider": "anthropic",    "model": "claude-haiku-4-5"
    // "provider": "google_genai", "model": "gemini-2.5-flash"
    // "provider": "xai",          "model": "grok-4-1-fast-non-reasoning"
    // "provider": "cerebras",     "model": "gpt-oss-120b"
    // "provider": "groq",         "model": "openai/gpt-oss-20b"
  },

  "example_queries": [
    "Read and briefly summarize the llm_mcp_config.json5 file in the current directory",
    "Fetch the raw HTML content from bbc.com and tell me the titile",
    // "Search for 'news in California' and show the first hit",
    // "Tell me about my authenticated GitHub profile",
    // "Tell me about my authenticated Notion account",
  ],

  "mcp_servers": {
    // Local MCP server that uses `npx`
    // https://www.npmjs.com/package/@modelcontextprotocol/server-filesystem
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "."  // path to a directory to allow access to
      ]
    },

    // Local MCP server that uses `uvx`
    // https://pypi.org/project/mcp-server-fetch/
    "fetch": {
      "command": "uvx",
      "args": [
        "mcp-server-fetch"
      ]
    },

    // Embedding the value of an environment variable
    // https://www.npmjs.com/package/@modelcontextprotocol/server-brave-search
    "brave-search": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-brave-search"
      ],
      "env": {
        "BRAVE_API_KEY": "${BRAVE_API_KEY}"
      }
    },

    // Example of remote MCP server authentication via Authorization header
    // https://github.com/github/github-mcp-server?tab=readme-ov-file#remote-github-mcp-server
    "github": {
      // To avoid auto protocol fallback, specify the protocol explicitly when using authentication
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
      }
    },

    // For remote MCP servers that require OAuth, consider using "mcp-remote"
    "notion": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.notion.com/mcp"],
    },
  }
}

Environment Variables

Create a .env file for API keys:

OPENAI_API_KEY=sk-ant-...
ANTHROPIC_API_KEY=sk-proj-...
GOOGLE_API_KEY=AI...
XAI_API_KEY=xai-...
CEREBRAS_API_KEY=csk-...
GROQ_API_KEY=gsk_...

# Other services as needed
GITHUB_PERSONAL_ACCESS_TOKEN=github_pat_...
BRAVE_API_KEY=BSA...

There are quite a few useful MCP servers already available:

Troubleshooting

  • Make sure your configuration and .env files are correct, especially the spelling of the API keys

  • Check the local MCP server logs

  • Use --verbose flag to view the detailed logs

  • Refer to Debugging Section in MCP documentation

Building from Source

See README_DEV.md for details.

Change Log

Can be found here

License

MIT License - see LICENSE file for details.

Contributing

Issues and pull requests welcome!
In particular, please share any issues relating to the latest versions of LLM models and specific MCP servers.
This tool aims to make MCP server testing as simple as possible.

Available Tools

2 tools
get-alertsC

Get weather alerts for a US state

ParametersJSON Schema
NameRequiredDescriptionDefault
stateYesTwo-letter US state code (e.g. CA, NY)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must carry full behavioral transparency. It only states the basic action without disclosing traits like read-only nature, authentication requirements, rate limits, or what type of alerts are returned. This is insufficient for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, achieving conciseness. It is appropriately front-loaded with the verb and resource. However, it lacks structure such as prerequisites or return format, but it remains efficient for its length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity (one required parameter, no output schema, no annotations), the description should provide more context, such as what the alerts contain or that it is a read operation. The minimal description leaves gaps for an agent to understand the tool's full context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for the 'state' parameter, so the baseline is 3. The description does not add any additional meaning beyond the schema; it simply restates the parameter's role without further context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('weather alerts') with a specific scope ('for a US state'). It distinguishes itself from the sibling 'get-forecast' by focusing on alerts, not forecasts, though it does not explicitly mention the sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'get-forecast'. The description does not include any prerequisites, context, or exclusions, leaving the agent to infer usage from tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get-forecastB

Get weather forecast for a location in the US

ParametersJSON Schema
NameRequiredDescriptionDefault
latitudeYesLatitude of the location
longitudeYesLongitude of the location

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose any behavioral traits such as data source, update frequency, or limitations of the forecast. The description only states the basic purpose.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that immediately communicates the tool's purpose. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with two parameters and no output schema, the description is minimal but covers the core purpose. However, it lacks usage guidance and behavioral details that would help an AI agent use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with both parameters described. The description adds no additional meaning beyond the schema; the mention of 'in the US' is a location constraint but not parameter-specific. Baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'Get', the resource 'weather forecast', and the scope 'for a location in the US'. It distinguishes from the sibling tool 'get-alerts' which likely deals with alerts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. The description does not indicate when to prefer this over 'get-alerts' or any other context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.1/5.0
Disambiguation5/5

The tools get-alerts and get-forecast have clearly distinct purposes: one provides weather alerts, the other gives forecasts. No overlap.

Naming Consistency5/5

Both tool names follow the consistent pattern 'get-<resource>', using lowercase and hyphens, which is predictable.

Tool Count2/5

With only 2 tools, the server feels too sparse for a weather domain. Typically, more operations like current conditions or radar would be expected.

Completeness2/5

The tool set only covers alerts and forecasts, missing common weather operations like current conditions, location search, or severe weather warnings, resulting in significant gaps.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hideya/mcp-client-langchain-py'

If you have feedback or need assistance with the MCP directory API, please join our Discord server