# FastMCP OpenAPI Project Instructions
This project is a FastMCP wrapper that dynamically generates MCP (Model Context Protocol) tools from OpenAPI specifications.
## Project Status: ✅ COMPLETE
All development tasks have been completed successfully:
- ✅ Project scaffolded with proper Python package structure
- ✅ Core functionality implemented (OpenAPI parsing, tool generation, MCP server)
- ✅ CLI interface created with multiple OpenAPI spec support
- ✅ Authentication support (Bearer, API Key, Basic Auth)
- ✅ Real MCP framework integration verified
- ✅ Parameter schema issues resolved (kwargs → proper function signatures)
- ✅ Testing infrastructure set up
- ✅ Documentation completed
## Project Overview
**Purpose**: Enable AI assistants to interact with any REST API by automatically generating MCP tools from OpenAPI/Swagger specifications.
**Key Features**:
- Dynamic tool generation from OpenAPI specs
- Type-safe parameter validation
- Multiple authentication methods
- Support for multiple APIs in one server
- CLI and programmatic interfaces
## Architecture
- `src/fastmcp_openapi/server.py` - Main MCP server implementation
- `src/fastmcp_openapi/parser.py` - OpenAPI specification parser
- `src/fastmcp_openapi/tool_generator.py` - Converts OpenAPI operations to MCP tools
- `src/fastmcp_openapi/client.py` - HTTP client for API calls
- `src/fastmcp_openapi/models.py` - Data models
- `src/fastmcp_openapi/config.py` - Configuration models
## Usage
```bash
# Basic usage
fastmcp-openapi --spec https://petstore.swagger.io/v2/swagger.json
# With authentication
fastmcp-openapi --spec https://api.example.com/openapi.json --auth-header "Bearer token"
# Multiple APIs
fastmcp-openapi --spec api1.json --spec api2.json --spec api3.json
# Test with MCP Inspector
npx @modelcontextprotocol/inspector fastmcp-openapi --spec examples/simple_api.json
```
## Development Guidelines
- Keep code clean and well-documented
- Follow Python type hints and Pydantic models
- Test with both local and remote OpenAPI specifications
- Ensure proper error handling and logging
- Maintain compatibility with MCP protocol standards
## Testing
- `test_mcp_langchain.py` - Integration test with LangChain MCP adapters
- `tests/` - Unit tests
- Use MCP Inspector for interactive testing
The project is production-ready and fully functional.