MCP protocol
Reference
The MCP protocol revisions the server speaks, its server info and instructions, the tools and resource templates it registers, and the annotations and result format of every tool.
The server implements the Model Context Protocol with the MCP TypeScript SDK (@modelcontextprotocol/server
^2.4.0, plus @modelcontextprotocol/node for HTTP).1 It serves two protocol revisions, 2025-11-25
and 2026-07-28, over both stdio and Streamable HTTP, from one server factory, so older and newer clients get the
same tools.2 3
This page describes what a client sees at the protocol level: the handshake, the server info and instructions, the registered tools and resource templates, the tool annotations and the result format. For the transports themselves, see Transports and HTTP transport.
Protocol revisions
| Revision | How a client selects it |
|---|---|
| 2025-11-25 | The client opens with initialize. |
| 2026-07-28 | Each request carries the 2026-07-28 _meta envelope (protocol version and client capabilities). The client can probe the server with server/discover. |
The SDK chooses the era per connection (stdio) or per request (HTTP). src/index.ts hands the createServer factory
to serveStdio; src/http.ts hands it to createMcpHandler, served through toNodeHandler. A 2025-era client that
opens with initialize is pinned to an instance from the same factory.4 5
2 The tests negotiate both revisions in process and over HTTP.6 7
Server info
SERVER_INFO in src/server.ts is sent in the handshake:8
| Field | Value |
|---|---|
name |
nsf-awards-mcp (the name in package.json) |
title |
NSF Awards |
version |
The version in package.json (2.0.0 at the time of writing) |
description |
Search and read U.S. National Science Foundation awards via the NSF Award API |
websiteUrl |
https://www.research.gov/common/webapi/awardapisearch-v1.htm |
package.json is the only source of the version; src/version.ts reads it for both the server info and the NSF API
client’s User-Agent header (nsf-awards-mcp/<version>).9 1 The HTTP transport’s
/health endpoint reports the same version.5
Server instructions
The server sends SERVER_INSTRUCTIONS as the instructions of the handshake, so a model learns the API’s quirks
before it calls a tool. The text, verbatim:8
Tools for the public U.S. National Science Foundation (NSF) Award API.
- Searches return at most 25 awards per call, newest start date first. Page with offset (use nextOffset from the result). The API counts and serves at most 10,000 matches; "capped": true means narrow the search.
- Records are compact summaries by default. Ask for detail "full" (about 3-5 KB per record, so lower limit), use printFields, or call get_award_details for the abstract and other fields. Amounts are numbers in US dollars; dates are mm/dd/yyyy. Inputs accept mm/dd/yyyy or yyyy-mm-dd.
- Name matching: awardeeName/institutionName, perfLocation and fundProgramName match the whole phrase; use full official names (not abbreviations such as MIT). pdPIName takes an unquoted full name. A first name alone is fuzzy, so always pair it with a last name. coPDPI with a last name alone matches every Co-PI with that surname.
- keyword matches awards containing any of the words; join words with uppercase AND to require all of them. Put one phrase in double quotes to match it exactly (only one quoted phrase per search). CAREER and similar award types are keywords, not program names.
- The order of awards with equal start dates can change between calls, so a page boundary may repeat or skip one.
- Project Outcomes Reports exist only for completed awards (roughly 2010 on). hasOutcomesReport in a record says whether get_project_outcomes will find one.
The facts behind each line are on Search parameters, Paging and limits and Search results.
What the server registers
createServer registers five tools, in this order, and then two resource templates. It registers no prompts.
8
Tools
| Name | Title | Page |
|---|---|---|
search_nsf_awards |
Search NSF Awards | search_nsf_awards |
get_award_details |
Get NSF Award Details | get_award_details |
get_project_outcomes |
Get NSF Project Outcomes Report | get_project_outcomes |
search_by_institution |
Search NSF Awards by Institution | search_by_institution |
search_by_pi |
Search NSF Awards by PI | search_by_pi |
Titles from the tool modules.10 Each tool is registered with its title, description, a Zod
inputSchema, a Zod outputSchema and the annotations below. In tools/list, both schemas appear as JSON Schema
objects, and the required arguments are institutionName for search_by_institution, lastName for search_by_pi
and awardId for the two lookups.8 6
Resource templates
| URI template | Name | MIME type |
|---|---|---|
| nsf://award/{id} | nsf-award |
application/json |
| nsf://award/{id}/outcomes | nsf-award-outcomes |
text/plain |
Both templates have no list callback, so they appear in resources/templates/list but resources/list offers no
concrete resources. Clients build the URI from an award ID.8 3
Tool annotations
Every tool gets the same annotations:8
| Annotation | Value |
|---|---|
title |
The tool’s title |
readOnlyHint |
true |
destructiveHint |
false |
idempotentHint |
true |
openWorldHint |
true |
All five tools only read public data from the NSF Award API.3 The tests check the four hint values for all five tools on both protocol revisions.6
Tool calls
The SDK validates the arguments against the input schema and applies the defaults before the handler runs, so handlers never re-parse their input.11 2 The handler returns data or throws:
- Success.
toCallToolResultreturns the data asstructuredContentand as JSON text incontent[0]. Search results carry a paging hint in theirhintfield, andtoCallToolResultrepeats any stringhintascontent[1]. The hint is in the data because some clients, Claude Code among them, forward only the structured content or the first block to the model. The SDK validatesstructuredContentagainst the output schema. 8 See Search results and Award record. - Failure. A thrown error becomes
{ content: [{ type: "text", text: <message> }], isError: true }. Invalid arguments and output that fails its schema are alsoisErrorresults. See Errors.
Each call is logged to stderr with the tool name and the elapsed milliseconds (Tool call completed at info,
Tool call failed at warn).8
Cancellation
The server passes the request’s abort signal (ctx.mcpReq.signal) to the handler, which passes it to the NSF API
client and on to the HTTP request. When a client cancels a call, the upstream request is aborted and is not retried.
Resource reads pass the same signal.8 11 One exception: the full result sets that
search_by_pi with includeCoPIs merges are shared between concurrent callers and cached, so a cancellation only abandons
that caller’s wait and the shared fetch continues. This holds only while the cache is on: with
NSF_API_CACHE_TTL_MS=0 the fetch uses the caller’s own signal, nothing is shared, and a cancellation aborts it.
12 See
NSF API client.
Examples
The annotations of search_nsf_awards as listed by tools/list:8
{
"name": "search_nsf_awards",
"title": "Search NSF Awards",
"annotations": {
"title": "Search NSF Awards",
"readOnlyHint": true,
"destructiveHint": false,
"idempotentHint": true,
"openWorldHint": true
}
}
A tool call in the 2025-11-25 form:
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "search_nsf_awards",
"arguments": { "keyword": "wildfire", "limit": 3 }
}
}
Under 2026-07-28 the same request also carries params._meta with io.modelcontextprotocol/protocolVersion
("2026-07-28") and io.modelcontextprotocol/clientCapabilities. SDK clients add these keys automatically. Over HTTP,
the SDK handles a request without them as a 2025-11-25 request, unless its MCP-Protocol-Version header names
2026-07-28, in which case it rejects the request as invalid params.