tool-agent-demo
Provides a tool to search a GitHub user's public repositories, filtering by substring match on name or description and limiting results, using the live GitHub REST API.
Provides a tool to query a local SQLite book database with filters such as author, genre, minimum year, and minimum rating, returning results ordered by rating.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tool-agent-demoFind fantasy books rated above 4.3 in the database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-tool-agent
A minimal end-to-end demonstration of the Model Context Protocol (MCP): one MCP server exposing three real tools, and a command-line agent that lets an LLM decide which tool to call and invokes it over the protocol.
Tool calls always travel through MCP (tools/list + tools/call over a
stdio JSON-RPC connection). The agent never imports the tool functions
directly.
The server
server.py is a FastMCP server named tool-agent-demo that speaks over
stdio. It exposes:
Tool | Description | Inputs |
| Lists a GitHub user's public repos, filtered by a substring match on name/description. Calls the live GitHub REST API. |
|
| Fetches a web page, strips scripts/styles/nav/header/footer, returns the visible text plus the page title. |
|
| Queries a local SQLite database of 20 books. Filters are AND-combined; results ordered by rating descending. |
|
Each tool's input schema is generated from its typed signature and returned
in tools/list.
Related MCP server: GitHub Code Search MCP Server
The agent
agent.py takes a natural-language question and:
Spawns
server.pyand connects over stdio with the MCP client.Runs the
initializehandshake, thentools/list.Converts the MCP tool definitions into the LLM's tool-calling format.
Asks the LLM (OpenAI,
gpt-4o-miniby default) to answer, with the tools available.For each tool call the model returns, executes it via
tools/calland feeds the result back.Prints the model's final answer once it stops calling tools (max 5 turns).
Every protocol step is logged to stderr with an [agent] prefix.
Setup
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # then set OPENAI_API_KEY
python seed_books.py # creates books.db.env keys:
OPENAI_API_KEY– required by the agent.OPENAI_MODEL– optional, defaults togpt-4o-mini.GITHUB_TOKEN– optional, raises the GitHub API rate limit.
Running
Run the agent with a question:
python agent.py "Which fantasy books in the database are rated above 4.3?"
python agent.py "Find repos owned by 'tiangolo' related to 'fastapi', top 3 by stars."
python agent.py "Fetch https://peps.python.org/pep-0020/ and list three aphorisms."To exercise the server on its own without an LLM:
python - <<'EOF'
import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def main():
params = StdioServerParameters(command="./venv/bin/python", args=["server.py"])
async with stdio_client(params) as (r, w):
async with ClientSession(r, w) as s:
await s.initialize()
print([t.name for t in (await s.list_tools()).tools])
res = await s.call_tool("query_books", {"genre": "fantasy", "min_rating": 4.4})
print(res.content[0].text)
asyncio.run(main())
EOFRecorded runs against all three tools, plus error paths (unknown user, unreachable/404/non-http URLs, missing database, schema validation), are in TEST_RUN.md.
Notes
Pinned to
mcp==1.29.1(the 1.xFastMCPAPI). The 2.x release renames the server class and changes several APIs.No secrets are committed;
.envandbooks.dbare gitignored.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables file system operations, web scraping, and AI-powered search through MCP tools for use by LLM agents.1
- AlicenseNot gradedqualityBmaintenanceEnables searching GitHub code with filters and reading arbitrary file contents from any repository via MCP.GPL 3.0
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to interact with GitHub via MCP, managing repositories, issues, PRs, and analyzing repository health through tools like list_repositories, read_issues, create_issue, comment_on_pr, and analyze_repo_health.
- FlicenseNot gradedqualityCmaintenanceMCP server exposing tools to fetch GitHub repository details, issues, and commits, enabling AI agents to query and summarize GitHub data via local LLMs.
Related MCP Connectors
Turn a GitHub repo or docs site into agent-ready context: pack it or search it, over MCP.
An MCP server that gives your AI access to the source code and docs of all public github repos
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/vamsi513/mcp-tool-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server