home / mcp / explore mcp server

Explore MCP Server

Provides a local MCP server exposing tools like ping, add, and subtract for OpenAI tool-calling demos.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "dhavaleswar-explore-mcp": {
      "url": "http://127.0.0.1:8000/mcp",
      "headers": {
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

You run a local MCP (Model Context Protocol) server to expose a set of programmable tools that a client can discover and use, including integration with OpenAI tool-calling. This lets you orchestrate tool-based actions from an LLM in a secure, local environment without exposing external endpoints.

How to use

Start the MCP server locally to expose tools like ping, add, and subtract at a known endpoint. Use the included client and OpenAI integration to let an LLM discover those tools and call them to produce a final result. Ensure your OpenAI API key is available so the system can query the model and invoke the tools.

How to install

Prerequisites you need to satisfy before installing: Python 3.13, a Linux or macOS shell, and an OpenAI API key.

# Option A: uv (recommended fast startup)
uv sync
```
```bash
# Option B: poetry
poetry install
poetry shell
```
```bash
# Option C: pip + venv
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt .

Additional notes

Set your OpenAI API key so the OpenAI integration can authenticate requests. The key can be placed in a file at ~/.llm_secrets with a line like OPENAI_API_KEY=sk-..., or you can export it in your shell as export OPENAI_API_KEY=sk-....

If you already have the key file, the helper will automatically load it. If the file is missing, set the environment variable manually.

Available tools

ping

A simple connectivity check tool that returns a basic response to verify the MCP server is reachable.

add

Takes two numeric inputs and returns their sum. Useful for arithmetic demonstrations with the OpenAI integration.

subtract

Subtracts one numeric input from another and returns the result, enabling basic arithmetic flows within the toolset.