An MCP Server for the Open Bank Project (OBP) API
OBP-MCP provides a Model Context Protocol (MCP) server that enables AI assistants to interact with the Open Bank Project API. It features a hybrid tag-based endpoint routing system designed for efficiency and cost-effectiveness when working with 600+ API endpoints.
-
π Tag-Based Routing: Fast, cost-effective endpoint discovery
-
π Lightweight Indexes: Minimal token usage with on-demand schema loading
-
π§ Core Endpoint Tools:
list_endpoints_by_tag- Discover endpoints by categoryget_endpoint_schema- Fetch full OpenAPI schemas on-demandcall_obp_api- Execute API requests with validation
-
π Glossary Tools: Access 800+ OBP term definitions
list_glossary_terms- Searc# OBP API Configuration OBP_BASE_URL="http://127.0.0.1:8080" OBP_API_VERSION="v6.0.0"
FASTMCP_HOST=127.0.0.1 FASTMCP_PORT=9100h and list glossary terms
get_glossary_term- Get full term definitions
-
π MCP Resources: URI-based access to glossary terms
- Python 3.12+
- OBP API access (base URL and API version)
Install uv on your machine:
curl -LsSf https://astral.sh/uv/install.sh | shpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Create a .env file with your configuration:
OBP_BASE_URL=https://apisandbox.openbankproject.com
OBP_API_VERSION=v5.1.0
FASTMCP_HOST=127.0.0.1
FASTMCP_PORT=9100Generate the lightweight endpoint index from the OBP API:
uv run python scripts/generate_endpoint_index.pyThis creates database/endpoint_index.json with endpoint summaries.
Generate the glossary index:
uv run python scripts/generate_glossary_index.pyThis creates database/glossary_index.json with glossary term definitions.
Run the server as an HTTP service:
# Install dependencies
uv sync
# Quick start with default settings (recommended)
./run_server.sh
# Development mode with auto-reload on file changes
./run_server.sh --watchThe server starts on http://0.0.0.0:9100 by default. Customize via .env or environment variables.
First, start the HTTP server:
./run_server.shThen configure the server in your VS Code MCP settings (~/.config/Code/User/mcp.json):
{
"mcpServers": {
"obp-mcp": {
"url": "http://0.0.0.0:9100/mcp",
"type": "http"
}
}
}For reference, see the example configuration in .vscode/mcp.json.example.
Discover endpoints filtered by tags:
list_endpoints_by_tag(["Account", "Transaction"])Returns lightweight summaries (id, method, path, summary, tags) without full schemas.
Fetch the full OpenAPI schema for a specific endpoint:
get_endpoint_schema("vVERSION-getBanks")Execute an API request:
call_obp_api(
"vVERSION-privateAccountsAtOneBank",
path_params={"BANK_ID": "gh.29.uk"},
headers={"Authorization": "DirectLogin token=..."}
)Access OBP glossary terms (800+ definitions):
Search and list glossary terms:
list_glossary_terms() # List all terms
list_glossary_terms("oauth") # Search for OAuth-related termsReturns a lightweight list with term IDs and titles.
Get the full definition of a specific term:
get_glossary_term("oauth") # Get OAuth definition
get_glossary_term("account-account-id") # Get Account ID definitionReturns the complete term with markdown and HTML descriptions.
Access OBP glossary terms via MCP resources (for clients that support resources):
Access obp://glossary to get all 800+ glossary terms with IDs and titles.
Access obp://glossary/{term_id} to get a specific term's full definition with markdown and HTML descriptions.
Examples:
obp://glossary/account-account-id- Account ID definitionobp://glossary/api- API definitionobp://glossary/bank-bank-id- Bank ID definition
- Hybrid Routing Guide - Detailed architecture and usage
The system uses lightweight JSON indexes for fast lookups:
- Tag-Based Discovery - Filter 600+ endpoints by category tags
- Lightweight Index - Minimal endpoint summaries (id, method, path, tags)
- On-Demand Schema - Load full OpenAPI schemas only when needed
- Glossary Index - Fast lookup of 800+ OBP term definitions
See docs/HYBRID_ROUTING.md for complete details.
OBP-MCP/
βββ src/
β βββ mcp_server_obp/ # MCP server implementation
β β βββ server.py # Tool definitions
β βββ tools/
β β βββ endpoint_index.py # Hybrid routing implementation
β β βββ retrieval/ # Legacy RAG tools
β βββ utils/ # Formatters and utilities
βββ database/
β βββ endpoint_index.json # Lightweight endpoint index
β βββ populate_vector_db.py # RAG database loader
βββ scripts/
β βββ generate_endpoint_index.py # Index generator
βββ docs/
βββ HYBRID_ROUTING.md # Architecture documentation
Update the endpoint index when the OBP API changes:
# Static endpoints (default)
python scripts/generate_endpoint_index.py
# Dynamic endpoints
python scripts/generate_endpoint_index.py --endpoints dynamic
# All endpoints
python scripts/generate_endpoint_index.py --endpoints allContributions are welcome! Please ensure:
- Code follows existing patterns
- Tools are well-documented
- Changes maintain backward compatibility
- Index generation works correctly
AGPLv3
For issues or questions:
- Check docs/HYBRID_ROUTING.md for detailed usage
- Verify environment variables are set correctly
- Ensure endpoint index is up to date