This guide provides detailed instructions for integrating the BudgetKey MCP Server with various AI clients and IDEs.
- Claude Desktop
- Visual Studio Code (Cline Extension)
- Cursor IDE
- Python Client (Direct Integration)
- Remote vs Local Deployment
- Troubleshooting
Claude Desktop natively supports MCP servers via HTTP connections.
-
Open Claude Desktop Settings:
- macOS: Claude Desktop → Settings → Developer → Edit Config
- Windows: Settings → Developer → Edit Config
-
Add the BudgetKey MCP server to your
claude_desktop_config.json:
{
"mcpServers": {
"budgetkey": {
"type": "http",
"url": "https://next.obudget.org/mcp"
}
}
}-
Save the file and restart Claude Desktop.
-
Verify the connection:
- Look for the 🔌 icon in Claude's interface
- The BudgetKey server should appear in the list of available servers
- You should see 3 tools: DatasetInfo, DatasetFullTextSearch, DatasetDBQuery
If you're running the server locally for development:
{
"mcpServers": {
"budgetkey-local": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}Note: You must start the server manually first:
cd /path/to/budgetkey-mcp
python server.pyFor running the server process directly from Python:
{
"mcpServers": {
"budgetkey": {
"command": "/path/to/uv",
"args": [
"run",
"--with",
"fastmcp",
"fastmcp",
"run",
"/path/to/budgetkey-mcp/server.py"
]
}
}
}Setup Requirements:
- Install
uv:pip install uv - Update
/path/to/uvto your actual uv installation path (find withwhich uv) - Update
/path/to/budgetkey-mcp/server.pyto the actual path
The Cline extension for VS Code supports MCP servers through a configuration file.
-
Install the Cline extension from the VS Code marketplace
-
Create a
.vscode/mcp.jsonfile in your project root:
For Remote Server:
{
"servers": {
"budgetkey": {
"type": "http",
"url": "https://next.obudget.org/mcp"
}
}
}For Local Development:
{
"servers": {
"budgetkey-local": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}- If running locally, start the server:
cd /path/to/budgetkey-mcp
python server.py-
In VS Code:
- Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Run:
MCP: List Servers - Start the BudgetKey MCP server
- Open the Copilot pane (Ctrl+Shift+I / Cmd+Shift+I)
- Switch to 'Agent' mode
-
Test the integration:
- Ask: "What datasets are available in BudgetKey?"
- The agent should have access to the 3 BudgetKey tools
Cursor IDE has built-in support for MCP servers.
-
In Cursor, open Settings (Cmd+, or Ctrl+,)
-
Navigate to: Tools & Integrations → MCP
-
Click Add Tool and select MCP Server
-
In the configuration file that opens, add:
For Remote Server:
{
"mcpServers": {
"budgetkey": {
"type": "http",
"url": "https://next.obudget.org/mcp"
}
}
}For Local Development:
{
"inputs": [
{
"type": "promptString",
"id": "local-port",
"description": "Local server port (default: 8000)",
"default": "8000"
}
],
"servers": {
"budgetkey-local": {
"type": "http",
"url": "http://localhost:${input:local-port}/mcp"
}
}
}-
Save the configuration
-
If running locally, start the server first:
cd /path/to/budgetkey-mcp
python server.py- Test the integration in Cursor's AI chat
You can integrate the BudgetKey MCP server directly into Python applications using the MCP SDK.
pip install mcp requestsimport asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def use_budgetkey_mcp():
# For HTTP server
server_url = "https://next.obudget.org/mcp"
# Connect to the server
async with stdio_client(
StdioServerParameters(
command="python",
args=["-m", "mcp.server.stdio"],
env={"MCP_SERVER_URL": server_url}
)
) as (read, write):
async with ClientSession(read, write) as session:
# Initialize the connection
await session.initialize()
# List available tools
tools = await session.list_tools()
print("Available tools:", [tool.name for tool in tools])
# Call DatasetInfo tool
result = await session.call_tool(
"DatasetInfo",
arguments={"dataset": "budget_items_data"}
)
print("Dataset info:", result)
# Run the example
asyncio.run(use_budgetkey_mcp())For simpler integration without the MCP SDK:
import requests
def get_dataset_info(dataset_id: str):
"""Get information about a BudgetKey dataset."""
url = "https://next.obudget.org/api/tables/{}/info".format(dataset_id)
response = requests.get(url, timeout=30)
response.raise_for_status()
return response.json()
def search_dataset(dataset_id: str, query: str):
"""Search within a BudgetKey dataset."""
url = "https://next.obudget.org/api/tables/{}/search".format(dataset_id)
response = requests.get(url, params={"q": query}, timeout=30)
response.raise_for_status()
return response.json()
def query_dataset(dataset_id: str, sql_query: str, page_size: int = 50):
"""Execute SQL query on a BudgetKey dataset."""
url = "https://next.obudget.org/api/tables/{}/query".format(dataset_id)
params = {
"query": sql_query,
"page_size": page_size
}
response = requests.get(url, params=params, timeout=60)
response.raise_for_status()
return response.json()
# Example usage
if __name__ == "__main__":
# Get dataset information
info = get_dataset_info("budget_items_data")
print("Columns:", info.get("columns", []))
# Search for items related to education
results = search_dataset("budget_items_data", "חינוך")
print("Search results:", len(results.get("results", [])))
# Query budget data
query_result = query_dataset(
"budget_items_data",
"SELECT year, title, net_allocated FROM budget_items_data WHERE year = 2025 LIMIT 10"
)
print("Query results:", query_result.get("rows", []))URL: https://next.obudget.org/mcp
Advantages:
- ✅ Always available
- ✅ No setup required
- ✅ Production data
- ✅ Automatic updates
Use when:
- Working with real Israeli budget data
- Sharing with others
- Production applications
URL: http://localhost:8000/mcp
Advantages:
- ✅ Fast iteration
- ✅ Offline development
- ✅ Custom modifications
- ✅ Debugging capabilities
Setup:
# Clone the repository
git clone https://github.com/OpenBudget/budgetkey-mcp.git
cd budgetkey-mcp
# Install dependencies
pip install -r requirements.txt
# Run the server
python server.pyUse when:
- Developing new features
- Testing modifications
- Learning how the server works
Solutions:
- Check the configuration file syntax (must be valid JSON)
- Restart Claude Desktop completely
- Check Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\logs\mcp*.log
- macOS:
- Verify the server URL is accessible:
curl https://next.obudget.org/mcp/health
Solutions:
- Check if port 8000 is already in use:
lsof -i :8000 # macOS/Linux netstat -ano | findstr :8000 # Windows
- Verify Python dependencies:
pip install -r requirements.txt
- Check for errors in the terminal where you ran
python server.py - Try a different port:
# Edit server.py, change the last line: mcp.run(transport='streamable-http', path='/mcp', host="0.0.0.0", port=8001)
Solutions:
- Verify the MCP connection is established (check for 🔌 icon in Claude)
- Try asking: "What tools do you have access to?"
- Restart the client application
- Check that the server URL includes the
/mcppath
Solutions:
- Test the underlying API directly:
curl "https://next.obudget.org/api/tables/budget_items_data/info" - Check your SQL syntax (must be PostgreSQL-compatible)
- Verify dataset names are correct (see README.md for list)
- Review the error message - the server provides detailed error information
Solutions:
- Check your internet connection
- Verify the server is running (for local development)
- Check firewall settings
- Try increasing timeout values in your client configuration
Solutions:
- Ensure your terminal/IDE supports UTF-8 encoding
- The server uses UTF-8 for all responses
- Check client display settings for Unicode support
You can configure multiple MCP servers simultaneously. For example, combine BudgetKey with other data sources:
{
"mcpServers": {
"budgetkey": {
"type": "http",
"url": "https://next.obudget.org/mcp"
},
"another-service": {
"type": "http",
"url": "https://example.com/mcp"
}
}
}For advanced use cases, you can customize the server:
- Clone and modify
server.py - Adjust
BUDGETKEY_API_BASEenvironment variable:export BUDGETKEY_API_BASE=https://custom-api.example.com python server.py - Update tools or instructions as needed
- Deploy your custom version
When using Claude Code (CLI), you can pre-approve specific tools:
{
"permissions": {
"allow": [
"mcp__budgetkey__DatasetInfo",
"mcp__budgetkey__DatasetFullTextSearch",
"mcp__budgetkey__DatasetDBQuery"
],
"deny": [],
"ask": []
}
}- Start with DatasetInfo: Always call
DatasetInfofirst to understand the dataset structure - Use Search for IDs: When you need identifiers, use
DatasetFullTextSearchfirst - Include item_url: Always include
item_urlin your SQL queries for direct links - Filter by Time: Always specify time periods in your queries
- Test Locally First: When developing new integrations, test with a local server
- Monitor Logs: Check server logs when debugging issues
- Cache Results: Consider caching frequent query results to reduce API load
- BudgetKey Website
- BudgetKey API Documentation
- MCP Protocol Specification
- FastMCP Documentation
- Main README
If you encounter issues not covered in this guide:
- Check the main README for general information
- Open an issue on GitHub
- Contact the BudgetKey team through the main website
- Review server logs for detailed error messages
Last updated: January 2026