govql-mcp-server

v0.4.0
govql-mcp-server Checked 7 hours ago Published 4 months ago

MCP server for GovQL — query US Congressional data via GraphQL from any MCP client.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

compare_voters Compare Voters

Compare how often two members voted the same way. Uses the precomputed `vote_similarity` aggregate (shared Yea/Nay votes and how many agreed) per congress+chamber. Returns each shared slice with an `agreementRate` (`agreed / sharedVotes`). Empty `comparisons` (with a message) if the two never served in the same chamber+congress.

ParameterTypeDescription
bioguide_id_a *stringFirst member's bioguide id (from find_legislator).
bioguide_id_b *stringSecond member's bioguide id (from find_legislator).
congressRestrict to one congress. Omit for every congress the two share.

describe_type Describe Type

Return the full description of one GraphQL type. Returns the type's `kind`, `description`, `fields` (with arg signatures), `inputFields` (for INPUT_OBJECT types), `enumValues` (for ENUM types), `interfaces`, and `possibleTypes` — everything you need to write a query against this type. For OBJECT types, `fields[].args` tells you what filters/pagination each field accepts. For INPUT_OBJECT types, `inputFields` is the list of accepted properties (e.g. `VoteFilter` has `category`, `chamber`, etc.). For ENUM types, `enumValues` lists the valid choices. Returns `{"data": {"type": {...}}}` on su…

ParameterTypeDescription
name *stringExact, case-sensitive name of a GraphQL type. Get valid names from `list_types`. Examples: 'Vote', 'VotePosition', 'Legislator', 'VoteFilter', 'VotesOrderBy', 'Query'.

find_legislator Find Legislator

Find legislators by attributes when you don't know a bioguide id. A locator: give it a name and/or state/party/chamber/district and it returns matching members with their bioguide id and a compact snapshot of their latest term (name, party, state, chamber, district). Identity search only — it does NOT return committee membership, tenure, or voting behavior (and the committees/bills tables aren't populated). For a member's full detail (bio plus complete term history), pass a returned `bioguideId` to `get_legislator`; for voting behavior, use the analysis tools (`get_voting_record`, `compare_…

ParameterTypeDescription
chamber'house'/'h' or 'senate'/'s'.
current_onlybooleanOnly members currently serving (a term ending in the future). Default true.
districtHouse district number (e.g. 3). House-only (senators have none); at-large districts are 0. Pair with state.
limitMax results (default 20, capped at 500).
nameCase-insensitive substring matched across first name, last name, official full name, and nickname.
partyParty: 'D'/'R'/'I' or a full name like 'Democrat'. Matches the member's term party.
stateTwo-letter USPS state code, e.g. 'CA'.

find_party_defectors Find Party Defectors

Find members who least often voted with their own party's majority. Ranks the own-party agreement rate (from `member_party_agreement`, where `other_party == member_party`) ascending, so the biggest defectors come first. Restrict with `party` or `chamber`; results carry each member's name.

ParameterTypeDescription
congress *integerCongress number, e.g. 118. Required.
chamber'house'/'h' or 'senate'/'s'. Omit for both.
limitMax results (default 20, cap 500). Lowest own-party agreement first.
partyLimit to one party ('D'/'R'/'I' or a full name). Omit to rank across all parties.

find_vote Find Vote

Find roll-call votes by category, chamber, or congress — newest first. The reliable path is browsing by facets: filter by `category` ('nomination', 'passage', 'cloture', 'amendment', ...), `chamber`, and/or `congress`, newest-first (e.g. "the most recent Senate nomination votes"). `topic` is a case-insensitive keyword match over the vote's `question` text. The question usually includes the bill's short title, so keyword search works for named bills and common terms — but it is NOT a subject index: procedural, cloture, and motion-to-proceed votes carry only the bill number, and bill subje…

ParameterTypeDescription
categoryVote category, e.g. 'nomination', 'passage', 'cloture', 'amendment'. Exact match.
chamber'house'/'h' or 'senate'/'s'.
congressCongress number, e.g. 118.
limitMax results (default 20, capped at 500). Newest first.
topicFree-text searched (case-insensitive) within the vote 'question' text, e.g. 'immigration'.

get_legislator Get Legislator

Return one member's identity and full term history. Includes names, birthday, gender, every term (party/state/chamber/district/ dates/how), and a `current` block derived from the term ending in the future (null if the member is not currently serving). `data.legislator` is null if the id doesn't exist.

ParameterTypeDescription
bioguide_id *stringThe member's bioguide id (e.g. 'P000145'). Get one from find_legislator.

get_vote_with_positions Get Vote With Positions

Return one roll-call vote with tallies, party breakdown, and optional member positions. By default returns vote metadata plus `totals` (Yea/Nay/Present/Not-Voting counts) and `party_breakdown` (counts per party × position) from the precomputed aggregates. Set `include_positions` (or pass any of `party`/`state`/`position`) to also get the individual member list. `data.vote` is null if the vote id doesn't exist.

ParameterTypeDescription
vote_id *stringThe vote id (e.g. 's192-119.2026'). Get one from find_vote.
include_positionsbooleanInclude the per-member position list — returns the full roster (up to ~500, byte-guarded). Default false — tallies only.
partyOnly positions from this party ('D'/'R'/'I'). Implies include_positions.
positionOnly this position: 'Yea','Nay','Present','Not Voting'. Implies include_positions.
positions_limitMax positions returned; default = the full roster (up to 500). Set lower to sample.
stateOnly positions from this state (2-letter). Implies include_positions.

get_voting_record Get Voting Record

Return a member's voting behavior per congress. For each congress: total roll calls; vote counts bucketed by meaning — yea (Yea/Aye/Guilty), nay (Nay/No/Not Guilty), present, notVoting, and other (Speaker-election and any non-yea/nay vote); a participation rate (votes cast / total — everything except Not Voting); and a party-loyalty rate (how often they voted with their own party's majority). The five vote buckets sum to totalVotes. Complements get_legislator (identity). `records` is empty if the member has no summary rows.

ParameterTypeDescription
bioguide_id *stringThe member's bioguide id. Get one from find_legislator.
congressRestrict to one congress (e.g. 118). Omit for all congresses, one record each.

list_types List Types

List the names and kinds of every type in the GovQL GraphQL schema. Call this first when you don't yet know what's queryable. The returned payload is small (a few KB) and gives you the type names you can then pass to `describe_type` for full details. Tip: most agents start with `list_types(kind="OBJECT")` to see just the queryable entities (Vote, Legislator, Bill, Committee, …), then call `describe_type("Query")` to see the available top-level query fields (such as `allVotes`, `allLegislators`, `voteByVoteId`). The OBJECT list also includes GovQL's **derived analytics views** (e.g. `VoteSi…

ParameterTypeDescription
kindOptional GraphQL type-kind filter, case-insensitive. Common values: 'OBJECT' (the queryable entities — Vote, Legislator, etc.), 'INPUT_OBJECT' (filter inputs like VoteFilter), 'ENUM' (orderBy enums)…

execute_graphql Execute Graphql

Execute a GraphQL query against the GovQL API and return the result. GovQL exposes US Congressional data — roll call votes (Congress 93 onward, every member's Yea/Nay/Present/Not Voting) and legislators (with terms, party, state, chamber) — via PostGraphile v5 at https://api.govql.us/graphql. Tables for bills, cosponsors, committees, and committee memberships exist in the schema but are not yet populated. Beyond the raw tables, GovQL precomputes the expensive cross-cutting analytics as **derived views** — prefer these over pulling `VotePosition` rows and aggregating yourself. The flags…

ParameterTypeDescription
query *stringA GraphQL query document. Must not be empty.
variablesOptional GraphQL variables, as a JSON object.