mcp-server-usace-iwr
mcp-server-usace-iwr
一个MCP(模型上下文协议)服务器,封装了美国陆军工程兵团(USACE)水资源研究所(IWR)的河流里程标志ArcGIS要素服务,让LLM能够定位美国通航河流上的河流里程标志,并回答"我在哪个河流里程位置?"这类问题。
数据集: USACE河流里程标志
服务:
https://services7.arcgis.com/n1YM8pTrFmm7L4hs/arcgis/rest/services/usace_river_mile_markers/FeatureServer/0认证: 无(公共服务)
坐标系: WGS84(EPSG:4326)十进制度数
工具
工具 | 用途 |
| 返回距离给定经纬度最近的一个标志(含距离和方位角)。 |
| 查找某点附近(半径内)或GeoJSON几何/边界框内的标志。 |
| 按河流名称和/或里程值范围筛选标志,支持分页。 |
所有工具均为只读,并返回溯源信息(来源机构、数据集、服务URL、图层、坐标系、检索时间)。
Related MCP server: pumperly-mcp
图层字段
name、LONGITUDE1、LATITUDE1、MILE、RIVER_CODE、RIVER_NAME、
RIVER_NUMB、SOURCE。
本地运行(stdio)
uv sync
uv run python -m usace_iwr_server.app服务器默认使用stdio传输方式。如果设置了PORT(或DATABRICKS_APP_PORT)环境变量,则改为在/mcp提供可流式HTTP服务,并附带/health就绪检查端点。
容器化/部署
bash scripts/build-and-push.sh # builds linux/amd64 and pushes to GHCR开发
uv run python -m py_compile src/usace_iwr_server/*.py src/usace_iwr_server/tools/*.py
npx @modelcontextprotocol/inspector uv run python -m usace_iwr_server.appAvailable Tools
3 toolsusace_rivermile_find_markersFind River Mile Markers Near a LocationARead-onlyIdempotent
Find USACE river mile markers near a point or within a geometry.
Accepts EITHER a lat/lon pair (+ radius_meters) OR a GeoJSON geometry string.
Use lat+lon when: "What river mile markers are near 31.45, -92.71?", "Markers within 2 km of this boat ramp?" Use geometry when: "Which markers fall inside this county polygon / bbox?", "Markers along this river-reach corridor?"
For point (lat/lon) queries, each returned marker includes 'distance_m' (great-circle meters from the query point) and results are sorted nearest-first. Geometry queries return markers intersecting the geometry.
Returns: { "count": int, # markers returned (after limit) "truncated": bool, # true if more markers matched than returned "markers": [ { name, MILE, RIVER_NAME, RIVER_CODE, RIVER_NUMB, LONGITUDE1, LATITUDE1, SOURCE, distance_m? }, ... ], "query": { "type": str, "radius_meters": float|null, "crs_epsg": int }, "provenance": { source agency, dataset, service URL, layer, CRS, retrieved_utc } }
Error responses:
"Error: supply either lat+lon or geometry, not both (or neither)"
"Error: 'geometry' is not valid JSON: ..."
"Error: unsupported geometry type ..."
"Error: River Mile request failed: ..."
Inputs: lat, lon, limit, geometry, +1 more. Returns: object
usace_rivermile_nearestNearest River Mile Marker to a LocationARead-onlyIdempotent
Return the single closest river mile marker to a WGS84 coordinate.
Answers "what river mile am I at?" / "nearest marker to this point". Searches within max_radius_meters and returns the nearest marker with its great-circle distance, plus a plain-language finding.
Returns: { "finding": str, # e.g. "Nearest marker: RED River, Mile 111, ~180 m NE" "found": bool, "nearest": { name, MILE, RIVER_NAME, RIVER_CODE, RIVER_NUMB, LONGITUDE1, LATITUDE1, SOURCE, distance_m, bearing } | null, "candidates_searched": int, "query": { "lat": float, "lon": float, "max_radius_meters": float, "crs_epsg": int }, "provenance": { source agency, dataset, service URL, layer, CRS, retrieved_utc } }
Error responses:
"Error: River Mile request failed: ..."
Inputs: lat (required), lon (required), max_radius_meters. Returns: object
usace_rivermile_queryQuery River Mile Markers by River and Mile RangeARead-onlyIdempotent
Query USACE river mile markers by river name and/or mile-value range.
Use when: "List markers on the RED river", "How many markers on the Mississippi between mile 400 and 600?", "Show markers on the Ohio above mile 900" (mile_min=900).
Results are ordered by MILE ascending and paginated. total_count reflects all matching markers; use next_offset to fetch the next page.
Returns: { "count": int, # markers on this page "total_count": int, # total markers matching the filter "has_more": bool, "next_offset": int|null, # pass as 'offset' to get the next page "where": str, # the WHERE clause applied (for transparency) "markers": [ { name, MILE, RIVER_NAME, RIVER_CODE, RIVER_NUMB, LONGITUDE1, LATITUDE1, SOURCE }, ... ], "provenance": { source agency, dataset, service URL, layer, CRS, retrieved_utc } }
Error responses:
"Error: mile_min cannot be greater than mile_max"
"Error: provide at least one filter (river_name, mile_min, or mile_max)"
"Error: River Mile request failed: ..."
Inputs: limit, offset, mile_max, mile_min, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: find_markers returns all markers near a point or within a geometry, nearest returns the single closest marker to a coordinate, and query filters by river name and mile range. Their descriptions are thorough and include usage guidance that eliminates ambiguity.
All tool names follow a `usace_rivermile_verb` pattern, using clear and descriptive verbs (find_markers, nearest, query). The naming is consistent and predictable, though slightly long. A minor deviation is that 'nearest' is an adjective rather than a verb, but the intent is still clear.
Three tools is an ideal count for this specialized domain. Each tool addresses a distinct and common query pattern for river mile markers: spatial search, nearest point, and attribute-based filtering. There are no redundant or missing core operations.
The tool set covers the primary use cases for querying river mile markers: proximity search, nearest-marker lookup, and attribute filtering/pagination. A minor gap is the lack of a tool to retrieve a single marker by ID or name, but the existing tools cover the most common workflows without dead ends.
Maintenance
Related MCP Connectors
Hosted MCP server for live public-data APIs and Skills for AI agents.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceAn experimental MCP server providing spatial context for LLMs by interfacing with French Geoplateforme services. It enables tasks such as geocoding, altitude lookups, and querying administrative, cadastral, or urban planning data.18 npm4MIT
- AlicenseAqualityBmaintenanceMCP server that exposes any Pumperly instance to LLMs, enabling real-time fuel price queries, station search, route planning, and geocoding.6124 npm3GPL 3.0
- AlicenseAqualityDmaintenanceAn MCP server that gives AI assistants direct access to the FEMA National Flood Hazard Layer (NFHL) for flood zone lookups, FIRM panel information, and flood map data in the United States.64 npmMIT
- FlicenseAqualityDmaintenanceAn MCP server that exposes Charlotte, NC and Mecklenburg County open data as tools for an LLM agent, enabling queries about trash pickup, parcels, zoning, crime, and more by geocoding addresses and querying live ArcGIS layers.21-