Thomas-TyTech/Socrata-MCP
If you are the rightful owner of Socrata-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Socrata MCP Server is a Model Context Protocol server designed to enable AI agents to interact with Socrata open data platforms using natural language, facilitating data queries and insights generation.
Socrata MCP Server
A Model Context Protocol (MCP) server that enables AI agents to query Socrata open data platforms using natural language and generate insights from the data.
Features
- Query Datasets: Execute SoQL queries on Socrata datasets with support for JSON, CSV, and GeoJSON formats
- Search Datasets: Find datasets by keywords across Socrata domains
- Dataset Information: Get metadata and schema information for datasets
- Natural Language Queries: Convert natural language questions to SoQL queries (basic implementation)
- Data Analysis: Generate insights including summaries, trends, correlations, and anomaly detection
Installation
# Clone the repository
git clone <repository-url>
cd socrata-mcp
# Install dependencies
pip install -e .
# Test the installation
python examples/test_functionality.py
Usage with MCP Clients
This is an MCP (Model Context Protocol) server that needs to be used with an MCP-compatible client. It cannot be used standalone - you must configure it with a client that supports MCP. There are many and I have listed a few below.
Supported MCP Clients
- Cline - VS Code extension for AI-assisted coding with Claude
- Claude Desktop - Anthropic's Claude desktop application
- Claude Code - TUI-based CLI tool by Anthropic
Configuration for Different Clients
Cline (VS Code Extension)
- Install the Cline extension in VS Code
- Open Cline settings and add this MCP server configuration:
{
"mcpServers": {
"socrata": {
"command": "python3",
"args": ["-m", "socrata_mcp.server"],
"cwd": "/path/to/your/socrata-mcp",
"env": {
"SOCRATA_APP_TOKEN": "your_app_token_here_optional"
}
}
}
}
Claude Desktop
- Download and install Claude Desktop
- Open Claude Desktop settings (usually
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS) - Add this configuration:
{
"mcpServers": {
"socrata": {
"command": "python3",
"args": ["-m", "socrata_mcp.server"],
"cwd": "/path/to/your/socrata-mcp",
"env": {
"SOCRATA_APP_TOKEN": "your_app_token_here"
}
}
}
}
Claude Code (TUI CLI Tool)
- Install Claude Code following the installation guide
- Add the MCP server using the
claude mcp addcommand:Or manually configure in your Claude Code settings following the MCP configuration guide# Basic syntax claude mcp add <name> <command> [args...] # Add Socrata MCP server claude mcp add socrata --env SOCRATA_APP_TOKEN=your_token_here \ -- python3 -m socrata_mcp.server
Configuration Notes
- Replace
/path/to/your/socrata-mcpwith the actual path to where you cloned this repository - SOCRATA_APP_TOKEN is optional but recommended for higher rate limits (get one free at dev.socrata.com)
- Use
python3orpythondepending on your system setup - Make sure you've installed the package first:
pip install -e .
Available Tools
Once configured with an MCP client, you'll have access to these tools:
- query_dataset: Execute SoQL queries on Socrata datasets
- search_datasets: Search for datasets by keywords across domains
- get_dataset_info: Get detailed metadata and schema information
- natural_language_query: Convert natural language questions to SoQL queries
- analyze_data: Generate statistical insights from query results
Example Usage
After configuring with an MCP client, you can ask questions like:
- "Find crime datasets in Chicago"
- "What are the most common types of crimes in Seattle?"
- "Show me building permits issued in San Francisco last year"
- "Analyze traffic accident trends in New York"
The AI assistant you connect the MCP server to will use the Socrata MCP to search for relevant datasets, query the data, and provide insights.