Skip to main content
Glama

sodabar ๐Ÿฅค

An MCP server that puts open data on tap โ€” four tools that let any LLM client search, inspect, and query 30,000+ civic datasets, with guardrails designed for a model on the other end.

CI Python MCP FastAPI License: MIT

Live demo: usmar-sodabar.static.hf.space โ€” the same console, answered in your browser straight from the live NYC Open Data API.

The problem โ€” and why it matters

Socrata powers the open-data portals of NYC, Chicago, Seattle, and hundreds of other governments โ€” tens of thousands of live, queryable datasets. But an LLM can't use any of it directly: it doesn't know which datasets exist, what their columns are called, or how to write a SoQL query against them. And if you naively hand a model a raw HTTP tool, it will page 500,000 rows into its own context window or paste an HTML error page into its reasoning.

sodabar is a Model Context Protocol server that closes that gap. It exposes the catalog โ†’ schema โ†’ query workflow as four typed tools, with the sharp edges filed off server-side: row caps a tool call cannot exceed, dataset-id validation that fails before a request leaves the machine, and upstream errors rewritten into messages a model can act on ("check the dataset id and domain") rather than tracebacks it will hallucinate around.

Point Claude Desktop, Claude Code, or any MCP client at it:

{
  "mcpServers": {
    "sodabar": {
      "command": "/path/to/sodabar/.venv/bin/python",
      "args": ["-m", "sodabar.server"]
    }
  }
}

Related MCP server: data-detective

What an agent session looks like

docs/agent-demo.md is a committed transcript of Gemini driving the server through the real MCP stdio transport. Given only the four tools and the question "Which NYC borough has logged the most 'Rodent' 311 complaints so far in 2026?", the model planned three calls on its own:

  1. search_datasets("311 Complaints") โ†’ found erm2-nwe9

  2. get_schema("erm2-nwe9") โ†’ learned complaint_type, created_date, borough

  3. query_dataset(select="borough, count(*)", where="complaint_type = 'Rodent' AND created_date BETWEEN โ€ฆ", group="borough", order="โ€ฆ DESC", limit=3)

and answered: Brooklyn 5,521 ยท Manhattan 3,528 ยท Queens 3,079. No SoQL was written by a human at any point.

docs/demo-transcript.md is the scripted equivalent โ€” every tool exercised over a real stdio subprocess session, regenerated with make demo.

The four tools

Tool

What it answers

search_datasets(query, domain, limit)

"What datasets exist about X?" โ€” full-text catalog search

get_schema(dataset_id, domain)

"What columns can I query, and what are their types?"

query_dataset(dataset_id, select, where, group, order, limit, offset, domain)

SQL-shaped aggregation and filtering via SoQL

profile_column(dataset_id, column, top)

"What values does this column take?" โ€” vocabulary before where clauses

domain defaults to data.cityofnewyork.us but accepts any Socrata portal (data.seattle.gov, data.cityofchicago.org, โ€ฆ), so one server covers hundreds of cities.

The playground

make serve starts a FastAPI app whose REST routes mirror the MCP tools one-to-one โ€” the console shows the exact tools/call envelope and the exact result an LLM client would see:

The sodabar console running a live aggregation: 311 complaints by borough in 2026, charted

Guardrails are part of the demo. A malformed tool call gets a readable, actionable error โ€” not a traceback:

The same console fed an invalid dataset id, answering with a friendly validation error

The live static deployment serves the identical HTML with a 4 KB fetch shim that answers the /api/* routes in-browser, straight from the Socrata APIs (which send Access-Control-Allow-Origin: *) โ€” a zero-backend demo of a backend project.

Key design decisions

  • Guardrails live server-side, not in the prompt. $limit is clamped to 1,000 rows no matter what the model asks for; dataset ids must match Socrata's xxxx-xxxx form (which also blocks path traversal through the resource URL); domains must be bare hostnames. A prompt can be ignored โ€” a clamp cannot.

  • Errors are written for the model that reads them. A 404 becomes "not found โ€” check the dataset id and domain"; a SoQL 400 surfaces Socrata's own message with "check your SoQL syntax". The retry policy distinguishes transient failures (429/5xx: three attempts with backoff) from semantic ones (400/404: fail immediately).

  • One client, three consumers. The MCP server, the FastAPI playground, and the demo scripts share one SocrataClient, so timeout, retry, and error behavior can't drift between what's tested and what's deployed.

  • Tool descriptions teach the workflow. The server's instructions and each tool's docstring steer a model toward search โ†’ schema โ†’ query and toward aggregating with group instead of paging raw rows โ€” the difference between a 6-row answer and a 6,000-row context spill.

  • Tests mock the transport, not the code. All 54 tests run against httpx.MockTransport โ€” CI needs no network and finishes in under a second, while retry logic, error mapping, and the FastAPI lifespan wiring are exercised for real.

Limitations

  • SoQL clauses are passed through to Socrata after shape checks, not parsed โ€” a syntactically valid but expensive query (e.g. group on a high-cardinality column) is bounded by the row cap and Socrata's own timeouts, nothing stricter.

  • Catalog search relies on Socrata's relevance ranking, which favors title matches; an agent may need two searches with different phrasings.

  • Anonymous (keyless) Socrata access is throttled upstream; sustained heavy use would need an app token, which the client doesn't currently send.

  • The committed transcripts hit the live API, so re-running make demo will show current counts, not the committed ones.

Reproduce it

git clone https://github.com/UsmarHaider/sodabar && cd sodabar
make venv        # python3 -m venv + editable install
make test        # 54 tests, no network needed
make demo        # scripted MCP stdio session โ†’ docs/demo-transcript.md (live API)
make serve       # playground at http://127.0.0.1:8012

cp .env.example .env   # then fill in GEMINI_API_KEY to run:
make agent-demo  # Gemini plans the tool calls โ†’ docs/agent-demo.md

Project layout

sodabar/
โ”œโ”€โ”€ sodabar/
โ”‚   โ”œโ”€โ”€ soql.py            # query validation: 4x4 ids, domain shape, row caps
โ”‚   โ”œโ”€โ”€ client.py          # shared Socrata HTTP client: retries, error translation
โ”‚   โ”œโ”€โ”€ server.py          # the MCP server (4 tools, stdio transport)
โ”‚   โ”œโ”€โ”€ service.py         # FastAPI playground mirroring the tools over REST
โ”‚   โ””โ”€โ”€ web/index.html     # self-contained console UI (no build step, no CDN)
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ demo_session.py    # scripted MCP client session โ†’ docs/demo-transcript.md
โ”‚   โ”œโ”€โ”€ agent_demo.py      # Gemini function-calling over the MCP session
โ”‚   โ”œโ”€โ”€ screenshot.sh      # headless-Chrome captures of the console
โ”‚   โ””โ”€โ”€ deploy_space.py    # builds + publishes the static HF Space demo
โ”œโ”€โ”€ tests/                 # 54 tests, all offline (httpx.MockTransport)
โ””โ”€โ”€ docs/                  # committed transcripts + UI screenshots

Available Tools

4 tools
get_schemaA

Get a dataset's name, description, and column names/types. Call this before querying so column names in SoQL clauses are exact.

ParametersJSON Schema
NameRequiredDescriptionDefault
domainNodata.cityofnewyork.us
dataset_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses what is returned (name, description, column names/types) and prefacing querying implies a read-only operation. However, it doesn't mention return format, pagination, or any other behavioral traits beyond the basics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the main purpose and followed by a practical usage hint. Every sentence earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and the presence of an output schema, the description covers the essential context: what the tool does and when to use it. The only gap is the meaning of the domain parameter, which is more of a parameter semantics issue than overall completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description should compensate for parameter meaning. It implies context for dataset_id via 'dataset's' but leaves domain completely unexplained. The schema default for domain is helpful but the description adds no value in clarifying its purpose.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Get' and clearly states the resource: a dataset's name, description, and column names/types. This distinguishes it from siblings like search_datasets, query_dataset, and profile_column, which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly instructs to call the tool before querying, explaining that this ensures column names in SoQL clauses are exact. This is a clear usage context, though it doesn't explicitly list exclusions or alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

profile_columnA

Show the most frequent values of one column with counts โ€” a quick way to learn a column's vocabulary before writing a where clause.

ParametersJSON Schema
NameRequiredDescriptionDefault
topNo
columnYes
domainNodata.cityofnewyork.us
dataset_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the transparency burden. It states the core behavior (shows frequent values with counts) and implies a read-only operation. However, it does not disclose edge-case behavior such as handling of nulls, the exact meaning of the 'top' parameter, or any limitations on output size. This is adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences, front-loaded with the action and followed by a purposeful rationale. Every word earns its place, with no fluff or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and has an output schema, so return values are covered. However, the lack of parameter explanations and the omission of usage context around dataset_id/domain leaves gaps. The description is complete enough for a basic understanding but not for confident invocation without further inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain parameter meaning. It only hints at 'one column' and 'most frequent values' (implying top), but does not explain 'dataset_id', 'domain', or 'top' explicitly. The description fails to compensate for the complete lack of schema descriptions for any parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Show the most frequent values of one column with counts' โ€” a specific verb, resource, and output. It also distinguishes itself from siblings by focusing on column vocabulary rather than dataset search, schema retrieval, or arbitrary querying.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear use case: 'a quick way to learn a column's vocabulary before writing a where clause.' This implies when to use it relative to querying but does not explicitly name alternatives or exclusions. It gives enough context to know when it is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_datasetA

Run a SoQL query against a dataset. Clauses mirror SQL: e.g. select='borough, count(*) as n', where="created_date > '2026-01-01'", group='borough', order='n DESC'. Rows are capped at 1000 per call.

ParametersJSON Schema
NameRequiredDescriptionDefault
groupNo
limitNo
orderNo
whereNo
domainNodata.cityofnewyork.us
offsetNo
selectNo
dataset_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full behavioral burden. It discloses the 1000-row cap per call, which is valuable, but it does not mention pagination via offset, error behavior, or authentication requirements. The transparency is moderate but incomplete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with purpose, and includes practical examples without any waste. Every word contributes to understanding the tool's function and syntax.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description effectively covers the core query capabilities and the row cap, which are the most critical aspects. The existence of an output schema covers return values, so the description doesn't need to explain them. Minor gaps like offset/limit semantics are not explicitly addressed, but they are intuitive from parameter names.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates by providing concrete examples for select, where, group, and order. Other parameters like dataset_id, domain, limit, and offset are self-evident from their names and defaults, so the overall parameter understanding is good.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs a SoQL query against a dataset, which is specific and distinct from sibling tools like search_datasets, get_schema, and profile_column. The examples reinforce this unique purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for querying data with SQL-like clauses, and the examples demonstrate syntax. It does not explicitly state when not to use it or mention alternatives, but the context is clear enough for a knowledgeable agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_datasetsA

Search a Socrata portal's catalog by keyword. Returns dataset ids, names, and descriptions. Use the returned id with get_schema/query_dataset.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
domainNodata.cityofnewyork.us

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It communicates that this is a read-only search operation and outlines the return fields, which is useful. However, it does not disclose potential behaviors like default domain scope, result limits, or rate limiting, leaving some ambiguity about execution expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, front-loads the core action, and has no wasted words. The second sentence adds essential workflow guidance without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the tool's purpose, return fields, and next steps, but falls short on parameter semantics and lacks any caveats about pagination, default domain, or result size. While an output schema exists, the absence of parameter descriptions and annotations makes the tool incomplete for an agent to invoke correctly without external knowledge.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It only mentions 'keyword' which maps to the 'query' parameter, but omits 'limit' and 'domain' entirely. The agent cannot infer the meaning or defaults of these parameters from the description, creating a significant gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb ('Search') and resource ('Socrata portal's catalog'), and explains what it returns (dataset ids, names, descriptions). It also distinguishes itself from siblings by explicitly linking the returned id to get_schema/query_dataset, establishing its role as the entry point.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides workflow context by stating 'Use the returned id with get_schema/query_dataset', which implies when to use this tool and what to do next. However, it does not explicitly mention when not to use it or alternative search strategies, leaving a small gap in exclusion guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedget_schema
    • First observedprofile_column
    • First observedquery_dataset
    • First observedsearch_datasets

TDQS

A4.2/5.0
Disambiguation5/5

Each tool has a clearly distinct role: searching for datasets, retrieving schema details, executing queries, and profiling column values. There is no overlap or ambiguity in purpose.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (search_datasets, get_schema, query_dataset, profile_column), making the API predictable and easy to navigate.

Tool Count5/5

With only 4 tools, the server is well-scoped for its purpose of exploring and querying Socrata datasets. Each tool is essential and contributes to a cohesive workflow.

Completeness5/5

The tool set covers the full lifecycle of dataset exploration: discover datasets, inspect schema, query data, and understand column vocabulary. No critical operations are missing for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    An MCP server for discovering, downloading, querying, and analyzing datasets from Ontario's open data portals, allowing natural language questions and high-performance analytics via DuckDB.
    23
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that gives AI assistants the ability to connect to, query, profile, and monitor data sources โ€” turning any LLM into an interactive data engineering copilot.
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    An MCP server that provides safe, read-only access to Boston's open data portal, enabling natural language exploration of civic datasets.
    2
    GPL 3.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    A governed MCP server enabling LLM agents to query BigQuery, inspect GCS, trigger Airflow DAGs, and run data-quality checks with built-in security guardrails like allow-lists, cost ceilings, and audit trails.
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/UsmarHaider/sodabar'

If you have feedback or need assistance with the MCP directory API, please join our Discord server