MCP Factory
Provides tools to fetch the Astronomy Picture of the Day (APOD) from NASA's API, including getting today's photo, photos by date, and random photos from the archive.
Click on "Deploy 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., "@MCP Factory get today's space photo"
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 Factory
An extensible Model Context Protocol (MCP) server framework with a service plugin architecture. Built with FastMCP and Python 3.13. Ships with a NASA APOD (Astronomy Picture of the Day) service as a reference implementation.
Add new API services by implementing a plugin -- your tools appear automatically in every MCP client. Fork the repo to build your own production MCP server from a solid, SOLID foundation.
Bundled Service: NASA APOD
The included APOD service demonstrates the plugin pattern with these features:
Get Today's Photo — Fetch the current Astronomy Picture of the Day with title, explanation, and media link.
Get Photo by Date — Retrieve any APOD entry from the archive (1995-06-16 to today) by providing a date.
Get Random Photo — Discover a random APOD from NASA's 30+ year archive.
Famous Space Dates Resource — A curated list of iconic space exploration dates to explore in the APOD archive.
Related MCP server: NASA MCP Server
Tools
Tool | Description |
| Returns today's APOD with title, explanation, media type, and URL |
| Returns the APOD for a specific date ( |
| Returns a random APOD from the full archive |
Resources
URI | Description |
| Curated list of famous space exploration dates |
Prerequisites
uv (recommended package manager)
Installation
git clone <your-repo-url>
cd mcp-factory
uv syncUsage
Running the server standalone
uv run main.pyThe server communicates over stdio transport, which is the standard for MCP client integrations.
Adding to Cursor IDE
Add the following to your Cursor MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"mcp-factory": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/mcp-factory",
"main.py"
]
}
}
}Replace /absolute/path/to/mcp-factory with the actual path to this project on your machine.
Adding to Claude Desktop
Add the following to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"mcp-factory": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/mcp-factory",
"main.py"
]
}
}
}API Key
The bundled APOD service uses NASA's DEMO_KEY by default, which has limited rate limits (30 requests/hour, 50 requests/day per IP). For heavier usage, request a free API key and set the NASA_API_KEY environment variable:
export NASA_API_KEY="your-key-here"Project Structure
mcp-factory/
├── main.py # Thin entry point — starts the MCP server
├── mcp_factory/ # Core package
│ ├── __init__.py
│ ├── config.py # Global config (server name)
│ ├── server.py # Builds FastMCP via ServiceRegistry
│ └── services/ # Service plugin architecture
│ ├── __init__.py
│ ├── base.py # ABCs: BaseAPIClient, BaseFormatter, ServicePlugin
│ ├── registry.py # ServiceRegistry factory
│ └── apod/ # APOD service plugin
│ ├── __init__.py # ApodService (registers tools + resources)
│ ├── config.py # APOD-specific constants and API key
│ ├── client.py # ApodClient (extends BaseAPIClient)
│ ├── formatter.py # ApodFormatter (extends BaseFormatter)
│ └── validation.py # APOD date validation
├── tests/ # Unit + E2E tests (pytest)
│ ├── test_base.py # ABC contract tests
│ ├── test_registry.py # ServiceRegistry factory tests
│ ├── test_apod_config.py # APOD config constants
│ ├── test_apod_client.py # ApodClient with mocked HTTP
│ ├── test_apod_formatter.py # ApodFormatter output
│ ├── test_apod_validation.py # Date validation
│ └── test_e2e.py # Full server bootstrap + tool execution
├── templates/ # Copy-paste service boilerplate
│ ├── README.md # Template usage instructions
│ └── service_template/ # Complete service plugin skeleton
├── docs/ # Guides, architecture, and workshop
│ ├── ARCHITECTURE.md # System design and SOLID mapping
│ ├── ADDING-A-SERVICE.md # Step-by-step new service guide
│ ├── ADDING-TOOLS.md # Tool and resource creation guide
│ ├── FORKING-GUIDE.md # Using this repo as a template
│ ├── DEVELOPMENT-WORKFLOW.md # Git, testing, and review workflow
│ ├── LETS-BUILD-AN-MCP-SERVER.md # Original step-by-step tutorial
│ └── index.html # Slide deck presentation
├── CLAUDE.md # AI agent context (Claude Code, etc.)
├── pyproject.toml # Project metadata and dependencies
├── uv.lock # Locked dependency versions
├── .python-version # Python version (3.13)
├── .gitignore # Git ignore rules
└── README.md # This fileExtending with a New API Service
This server uses a service plugin architecture. Each API is a self-contained plugin under mcp_factory/services/. To add a new API:
Create a new directory:
mcp_factory/services/your_api/Implement a client extending
BaseAPIClient(handles HTTP)Implement a formatter extending
BaseFormatter(handles Markdown output)Create a service class with a
register(mcp)method that registers your toolsAdd it to the registry in
mcp_factory/server.py:
from mcp_factory.services.your_api import YourApiService
registry.add(YourApiService())Your new tools appear automatically -- no other files need to change.
Documentation
For Developers
Guide | Description |
System design, plugin lifecycle, data flow, SOLID principles, module map | |
Step-by-step guide to adding a new API service plugin | |
How to add tools and resources to an existing service | |
Using this repo as a template for a new MCP server | |
Git workflow, testing strategy, code review checklist | |
Original step-by-step MCP server tutorial |
For AI Agents
Resource | Description |
Root-level context file for Claude Code and agentic frameworks | |
| Always-on architecture context for Cursor AI |
| Step-by-step instructions triggered when extending services |
| Tool routing rules for bundled APOD service |
Boilerplate Templates
Copy-paste-ready service skeleton at templates/service_template/. See templates/README.md for usage.
Dependencies
mcp[cli] — Model Context Protocol SDK with CLI support
httpx — Async HTTP client for external API calls
License
This project is for educational and personal use. The bundled APOD service uses data from NASA's APOD API.
Available Tools
8 toolsget_random_space_photoA
Get a random Astronomy Picture of the Day from NASA's archives.
Inputs: no named parameters. Returns: result
get_space_photo_by_dateA
Get the Astronomy Picture of the Day for a specific date (YYYY-MM-DD).
Inputs: date (required). Returns: result
get_todays_space_photoA
Get today's Astronomy Picture of the Day from NASA.
Inputs: no named parameters. Returns: result
scan_codebaseA
Run a full multi-pass security and quality scan on a codebase directory.
Executes all analyzers: secret detection, OWASP security patterns, debug statement detection, code quality checks, style linting, and dependency vulnerability scanning via OSV.dev.
Use this when asked to review, audit, or scan a codebase for issues.
Inputs: path (required). Returns: result
scan_code_qualityA
Scan a codebase for code quality and style issues.
Checks for debug/print statements, oversized files, long lines, deep nesting, too many function parameters, trailing whitespace, TODO/FIXME comments, mixed indentation, superfluous comments, and naming convention violations (PEP 8 for Python, camelCase for JS/TS).
Use this when asked to check code quality, readability, or style.
Inputs: path (required). Returns: result
scan_dependenciesA
Scan a project's dependency manifests for known CVEs via OSV.dev.
Parses package.json, requirements.txt, pyproject.toml, go.mod, Cargo.toml, and Gemfile.lock, then queries the OSV vulnerability database for each dependency.
Use this when asked to check dependencies for vulnerabilities or CVEs.
Inputs: path (required). Returns: result
scan_secretsA
Scan a codebase directory for exposed secrets, API keys, and credentials.
Detects AWS keys, GitHub tokens, GCP keys, Slack tokens, JWTs, private keys, database connection strings, and generic hardcoded secrets.
Use this when asked to check for leaked credentials or secrets.
Inputs: path (required). Returns: result
scan_security_patternsA
Scan a codebase for OWASP-style security antipatterns.
Detects SQL injection vectors, XSS sinks, eval/exec usage, insecure cryptographic primitives, path traversal, insecure deserialization, and shell injection patterns.
Use this when asked about security vulnerabilities or OWASP compliance.
Inputs: path (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The space photo tools are clearly distinct (random, specific date, today). The scanning tools are also distinct, though the comprehensive scan_codebase overlaps with the individual scanners; descriptions help clarify when to use each. The two domains are unrelated but clearly named, reducing confusion.
All tool names follow a consistent verb_noun pattern (get_*_space_photo for photos, scan_* for code scans). No mixing of conventions, making them predictable and easy to navigate.
With 8 tools across two domains, the count is well-scoped. The space photos domain has 3 tools (covers essential queries) and the scanning domain has 5 tools (comprehensive coverage without excess).
The space photo tools cover random, specific date, and today—sufficient for basic retrieval. The scanning tools cover quality, dependencies, secrets, security patterns, and a full scan, leaving few gaps. Missing features like search or description retrieval for photos are minor.
Maintenance
Related MCP Connectors
Model Context Protocol server for Studex tools, notifications, and profile integrations
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Real-time planetary signal engine and Model Context Protocol (MCP) server for autonomous AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA modular server that implements the Model Context Protocol standard, providing tools for interacting with GitHub, GitLab, Google Maps, Memory storage, and web automation through a unified gateway.512 npm3Apache 2.0
- AlicenseBqualityBmaintenanceA Model Context Protocol server that provides a standardized interface for AI models to interact with NASA's vast array of data sources including APOD, Mars Rover photos, satellite imagery, and space weather data.3295 npm94ISC
- FlicenseDqualityDmaintenanceA modular, extensible Model Context Protocol server framework designed for Claude Desktop that uses convention-based automatic module discovery to easily extend AI application functionality without modifying core code.43-
- AlicenseCqualityDmaintenanceA Model Context Protocol (MCP) server that provides access to NASA's Astronomy Picture of the Day (APOD) API.2ISC