@pipeworx/mcp-census 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +121 -9
- package/bin/cli.js +17 -0
- package/package.json +15 -3
- package/server.json +2 -2
- package/src/index.ts +1090 -54
- package/src/server.ts +45 -0
- package/tsconfig.json +5 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,17 +1,49 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Census — US Census Bureau
|
|
2
2
|
|
|
3
|
-
Census
|
|
3
|
+
The official US Census Bureau data: decennial census, American Community Survey (ACS), economic census, population estimates, housing characteristics, geographic boundaries. National, state, county, place, tract, block-group, and ZCTA-level. Free, no key required for public datasets.
|
|
4
4
|
|
|
5
|
-
Part of
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1679+ live data sources.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Why this matters for AI agents
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
Demographics, housing characteristics, economic activity, geographic identifiers — Census is the authoritative source. If an agent is computing per-capita rates, comparing metros, looking up population, or working with FIPS codes, this is where it goes.
|
|
10
|
+
|
|
11
|
+
Common flows:
|
|
12
|
+
|
|
13
|
+
- **Population for an area.** ACS 1-year or 5-year estimates by state/county/place.
|
|
14
|
+
- **Housing characteristics.** Median home value, occupancy, units, age — all in ACS.
|
|
15
|
+
- **Geographic ID lookup.** Place name → FIPS code → boundary geometry.
|
|
16
|
+
- **Economic Census** every 5 years for industry-level economic activity.
|
|
17
|
+
|
|
18
|
+
Pair with [FRED](/docs/reference/fred) for time-series macro and [BLS](/docs/reference/bls) for labor.
|
|
19
|
+
|
|
20
|
+
## Auth
|
|
21
|
+
|
|
22
|
+
Most Census APIs are free and unauthenticated, with light rate limits (~500 calls/day per IP). For higher rates, get a key at https://api.census.gov/data/key_signup.html and pass via `_apiKey`.
|
|
23
|
+
|
|
24
|
+
## Datasets worth knowing
|
|
25
|
+
|
|
26
|
+
| Dataset | Cadence | Geography |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| Decennial Census (PL, DHC) | 10-year | Block-level and up |
|
|
29
|
+
| ACS 5-year | Annually-rolling | Tract/BG (5-year smoothing) |
|
|
30
|
+
| ACS 1-year | Annually | Places ≥65k population |
|
|
31
|
+
| Population Estimates Program (PEP) | Annually | County-level |
|
|
32
|
+
| Economic Census | 5-year | Industry × geography |
|
|
33
|
+
|
|
34
|
+
ACS 5-year is what you usually want for current demographics — it's available at finer geographies than 1-year and updates yearly with rolling 5-year smoothing.
|
|
35
|
+
|
|
36
|
+
## Common pitfalls
|
|
37
|
+
|
|
38
|
+
- **Year-of-coverage vs release year.** ACS 5-year 2018-2022 was released in 2023. Don't conflate.
|
|
39
|
+
- **Margins of error.** ACS includes MOE for every estimate. At small geographies (block group, small tract), MOEs can be larger than the estimate. Always carry MOE through to the user.
|
|
40
|
+
- **Geography hierarchy.** State (`01`) → County (`01001`) → Tract (`01001020100`) → Block Group. The 11-digit tract code is state(2) + county(3) + tract(6).
|
|
41
|
+
- **Place vs MSA.** "Denver" can mean the City and County of Denver, OR the Denver-Aurora-Lakewood Metropolitan Statistical Area (very different boundaries and populations). Disambiguate per use case.
|
|
42
|
+
- **Population estimates lag the decennial.** Between censuses, PEP estimates are extrapolated and revised. The Census Bureau revises previous PEPs each year as they reconcile with births/deaths/migration data.
|
|
11
43
|
|
|
12
44
|
## Quick Start
|
|
13
45
|
|
|
14
|
-
Add to your MCP client
|
|
46
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
15
47
|
|
|
16
48
|
```json
|
|
17
49
|
{
|
|
@@ -23,12 +55,92 @@ Add to your MCP client config:
|
|
|
23
55
|
}
|
|
24
56
|
```
|
|
25
57
|
|
|
26
|
-
|
|
58
|
+
### What this endpoint actually serves
|
|
59
|
+
|
|
60
|
+
`tools/list` at `https://gateway.pipeworx.io/census/mcp` returns the tools in the table
|
|
61
|
+
above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
|
|
62
|
+
`discover_tools`, `search_within`, `remember`/`recall` and the rest of the
|
|
63
|
+
gateway-wide set. So the tool count you see is larger than this table: a
|
|
64
|
+
single-pack endpoint currently lists roughly 30 shared tools alongside the
|
|
65
|
+
pack's own. The connection's `initialize` response states its exact scope, and
|
|
66
|
+
is the authoritative answer for a given day.
|
|
67
|
+
|
|
68
|
+
This is deliberate, not multiplexing by accident. The meta-tools are what let a
|
|
69
|
+
scoped connection answer a question this pack does not cover — via
|
|
70
|
+
`ask_pipeworx`, which routes across the whole catalog — without you adding a
|
|
71
|
+
second MCP server. There is currently no way to mount a pack endpoint without
|
|
72
|
+
them; if the extra schemas cost you more context than the routing is worth,
|
|
73
|
+
connect to the full gateway once rather than to several pack endpoints.
|
|
74
|
+
|
|
75
|
+
Or connect to the full Pipeworx gateway to get every pack's tools listed
|
|
76
|
+
directly, instead of just this one's:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mcpServers": {
|
|
81
|
+
"pipeworx": {
|
|
82
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Both URLs reach the same gateway and the same 1679+ data sources. The
|
|
89
|
+
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
|
|
90
|
+
reaches all of them from either one.
|
|
91
|
+
|
|
92
|
+
## No MCP client? Call it over HTTP
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
curl -X POST https://gateway.pipeworx.io/v1/tools/census_population \
|
|
96
|
+
-H 'Content-Type: application/json' \
|
|
97
|
+
-d '{"place":"Travis County, TX"}'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/census_population`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
|
|
101
|
+
|
|
102
|
+
## Standalone (no gateway account)
|
|
103
|
+
|
|
104
|
+
This package also runs as a local stdio MCP server — no Pipeworx account, no
|
|
105
|
+
gateway round-trip:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"mcpServers": {
|
|
110
|
+
"census": {
|
|
111
|
+
"command": "npx",
|
|
112
|
+
"args": ["-y", "@pipeworx/mcp-census"]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Or run it directly to confirm it starts:
|
|
27
119
|
|
|
28
120
|
```bash
|
|
29
|
-
npx pipeworx
|
|
121
|
+
npx -y @pipeworx/mcp-census
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
|
|
125
|
+
for **only** this pack's tools — none of the shared meta-tools the gateway
|
|
126
|
+
connection above adds. Same source, same tools, no ask_pipeworx routing.
|
|
127
|
+
|
|
128
|
+
## Using with ask_pipeworx
|
|
129
|
+
|
|
130
|
+
Instead of calling tools directly, you can ask questions in plain English —
|
|
131
|
+
this works on the pack endpoint above as well as on the full gateway:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
ask_pipeworx({ question: "your question about Census data" })
|
|
30
135
|
```
|
|
31
136
|
|
|
137
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
138
|
+
|
|
139
|
+
## More
|
|
140
|
+
|
|
141
|
+
- [Docs and guides](https://pipeworx.io/docs)
|
|
142
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
143
|
+
|
|
32
144
|
## License
|
|
33
145
|
|
|
34
146
|
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//
|
|
3
|
+
// Entry point for `npx @pipeworx/mcp-<slug>`.
|
|
4
|
+
//
|
|
5
|
+
// Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
|
|
6
|
+
// tsx sidesteps every extensionless-import / bare-JSON-import edge case a
|
|
7
|
+
// per-pack tsc build would have to solve one pack at a time). This file
|
|
8
|
+
// registers tsx's ESM loader programmatically, then hands off to src/server.ts,
|
|
9
|
+
// which wraps the pack's {tools, callTool} export in a stdio MCP server.
|
|
10
|
+
//
|
|
11
|
+
// Copied verbatim into every published pack repo by scripts/publish-pack.sh —
|
|
12
|
+
// edit this file, not a per-pack copy.
|
|
13
|
+
import { register } from 'tsx/esm/api';
|
|
14
|
+
|
|
15
|
+
register();
|
|
16
|
+
|
|
17
|
+
await import('../src/server.ts');
|
package/package.json
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipeworx/mcp-census",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Census MCP — U.S. Census Bureau housing-relevant APIs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"types": "src/index.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mcp-census": "bin/cli.js"
|
|
10
|
+
},
|
|
8
11
|
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "census"],
|
|
9
12
|
"license": "MIT",
|
|
10
13
|
"repository": {
|
|
11
14
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/pipeworx-io/mcp-census"
|
|
15
|
+
"url": "git+https://github.com/pipeworx-io/mcp-census.git"
|
|
13
16
|
},
|
|
14
17
|
"scripts": {
|
|
15
18
|
"typecheck": "tsc --noEmit"
|
|
16
19
|
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
22
|
+
"tsx": "^4.19.0"
|
|
23
|
+
},
|
|
17
24
|
"devDependencies": {
|
|
18
|
-
"typescript": "^5.
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"@cloudflare/workers-types": "^4.20260405.1"
|
|
27
|
+
},
|
|
28
|
+
"pipeworx": {
|
|
29
|
+
"sourceHash": "v1-0227716c59b49153478c951e0a35f552187c6ba16814616198e56fd32494ab72",
|
|
30
|
+
"sourceCommit": "60f04b68c347e970c6be94a53439d1364061fc06"
|
|
19
31
|
}
|
|
20
32
|
}
|
package/server.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.pipeworx-io/census",
|
|
4
|
-
"title": "
|
|
4
|
+
"title": "Census",
|
|
5
5
|
"description": "Census MCP — U.S. Census Bureau housing-relevant APIs.",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.1",
|
|
7
7
|
"websiteUrl": "https://pipeworx.io/packs/census",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/pipeworx-io/mcp-census",
|