home / mcp / explore mcp server
Provides a local MCP server exposing tools like ping, add, and subtract for OpenAI tool-calling demos.
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.
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.
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 .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.
A simple connectivity check tool that returns a basic response to verify the MCP server is reachable.
Takes two numeric inputs and returns their sum. Useful for arithmetic demonstrations with the OpenAI integration.
Subtracts one numeric input from another and returns the result, enabling basic arithmetic flows within the toolset.