Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/mcp_gh_repo_analyzer/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
Empty file.
28 changes: 28 additions & 0 deletions examples/mcp_gh_repo_analyzer/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from fastmcp import FastMCP, Client
from fastmcp.client.transports import StdioTransport

mcp = FastMCP(
name="MCP Server Repo Analyzer",
version="0.1.0",
description="An MCP Server that discovers MCP servers on GitHub."
)

@mcp.tool()
async def test_mcp_server(command: str, args: list[str] = [],env: dict[str, str] = {}):
"""_summary_

Args:
command (str): _description_
args (list[str], optional): _description_. Defaults to [].
env (dict[str, str], optional): _description_. Pull the env vars from the env with the same name. Defaults to {}.

Returns:
_type_: _description_
"""
client = Client(transport=StdioTransport(command=command, args=args, env=env))
async with client:
print(f"Client is connected: {client.is_connected()}")
return await client.list_tools()

if __name__ == "__main__":
mcp.run()
87 changes: 87 additions & 0 deletions examples/mcp_gh_repo_analyzer/nanobot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
publish:
tools: [mcp_gh_repo_analyzer]

agents:
mcp_gh_repo_analyzer:
model: gpt-4.1
instructions: |
You are an agent that extracts features from GitHub repositories for Model Context Protocol (MCP) servers.
1. Use search_repositories to get the Repo object (stars, forks, license, etc).
2. Retrieve the entire README (do not truncate).
3. Using the repo and README, determine if the project is an MCP server (not an SDK, client, inspector, or platform).
- If not an MCP server, set description to 'Not an MCP server' and leave other fields blank.
4. For MCP servers, extract: repo URL, name, description, readme, license, stars, forks.
5. Use only the README to determine if the server runs via Docker, UVX, or NPX, and extract activation commands.
6. Determine if filesystem access or credentials are required.
7. If the server command is run via Docker, UVX, or NPX, use the test_mcp_stdio_server tool and list its tools. (or provide the raw response if unsuccessful).
tools: [github_mcp_server, test_mcp_stdio_server]
output:
strict: true
schema:
type: object
required:
- repo_name
- description
- license
- stars
- forks
- docker
- uvx
- npx
- filesystem_access
- credentials
- example_activation_commands
- readme
- tools
additionalProperties: false
properties:
repo_name:
type: string
description:
type: string
description: "Explains what the MCP Server does in a succinct way."
license:
type: string
stars:
type: integer
forks:
type: integer
docker:
type: string
description: "Does the repo run via Docker? (Y/N)"
uvx:
type: string
description: "Does the repo run via UVX? (Y/N)"
npx:
type: string
description: "Does the repo run via NPX? (Y/N)"
filesystem_access:
type: string
description: "Does the MCP Server require filesystem access? (Y/N)"
credentials:
type: string
description: "Does the MCP Server require credentials? (Y/N)"
example_activation_commands:
type: string
readme:
type: string
description: "The entire unabbreviated README of the repo."
tools:
type: string
description: "The tools returned via the test_mcp_stdio_server tool, or the error message if unsuccessful."

mcpServers:
github_mcp_server:
command: "docker"
args:
- run
- -i
- --rm
- -e
- GITHUB_PERSONAL_ACCESS_TOKEN
- ghcr.io/github/github-mcp-server
test_mcp_stdio_server:
command: "uv"
args:
- run
- main.py
9 changes: 9 additions & 0 deletions examples/mcp_gh_repo_analyzer/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[project]
name = "test-mcp-stdio-server"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"fastmcp>=2.3.4",
]
Loading