Architecture

  • Request flow - How a tool call travels from the transport through createServer, the tool handler and the NSF API client, and how results, errors and output schemas are shaped on the way back.
  • Transports - How the server is served over stdio or Streamable HTTP from one server factory, how each transport picks the MCP protocol era, and how the HTTP app routes, checks Host and Origin, and shuts down.
  • NSF API client - The NSFApiClient class that owns every NSF Award API quirk: parameter preparation, response parsing, serviceNotification errors, retries, cancellation, and the cached multi-page fetch behind search_by_pi with includeCoPIs.
  • Normalization - How raw NSF API records become normalized NSFAward objects, and how the server shapes them into summaries, full records and printFields projections, normalizes dates, and converts outcome report HTML to text.