[FEATURE] Support MCP resources and prompts for GitNexus context workflows

Author: FenjuFuCreated Aug 30, 2026Updated Aug 30, 2026

Problem

Astron Agent's current MCP integration exposes tool discovery and tool execution only. The client session calls list_tools() and call_tool(), and the public request/response schemas have no operations for MCP resources or prompts.

GitNexus is a concrete fixture where this loses high-value, read-only context:

  • resources such as gitnexus://repos, repository context, clusters, processes, schema, and group status/contracts;
  • guided prompts such as detect_impact and generate_map.

Without list_resources / read_resource and list_prompts / get_prompt, Astron workflows must reconstruct this context through extra tool calls or cannot use it at all.

Proposed solution

Add first-class MCP resource and prompt operations alongside the existing tool APIs:

  1. Extend the transport service to call ClientSession.list_resources, read_resource, list_prompts, and get_prompt on the already initialized Streamable HTTP/SSE session.
  2. Add typed request/response schemas that preserve cursors, resource metadata, prompt arguments, text/blob contents, annotations, and protocol errors without flattening them into fabricated tool results.
  3. Keep server selection and transport negotiation identical to tool listing/calls, including the same URL, blacklist, loopback, and future credential resolution policies.
  4. Treat resource URIs as opaque MCP identifiers after the server session is established; never fetch a resource URI as an arbitrary HTTP URL.
  5. Add bounded response sizes, cursor/page limits, timeouts, and explicit truncation/error metadata. Do not auto-read every advertised resource into model context.
  6. Let an operator select which resources/prompts an agent or workflow may use, and audit server, operation, URI/prompt name, duration, result size, and status without logging sensitive content.
  7. Preserve MCP content types and errors; unsupported content must remain explicit instead of being silently dropped.

Acceptance fixture

Pin:

  • iflytek/astron-agent@aaef2a286b9fb8396d42d5d4f6bb7af9b19afa22
  • abhigyanpatwari/GitNexus@4e51213c82249d5c235f8535d8292bd56de8c01a

Using a controlled GitNexus MCP test server (or an in-process protocol fixture):

  • list_resources returns gitnexus://repos and repository-scoped resource templates/metadata with pagination preserved.
  • read_resource reads a bounded known resource such as repository context and returns its real MIME/content type.
  • list_prompts returns detect_impact and generate_map with their argument schemas.
  • get_prompt preserves prompt messages and roles for valid arguments and returns a protocol error for invalid arguments.
  • A resource URI is never dereferenced outside the selected MCP session.
  • Tool, resource, and prompt operations share the same transport and credential policy.
  • Oversized, malformed, binary, and unsupported content produces bounded explicit results rather than memory growth or silent loss.
  • Server errors, timeouts, session closure, and pagination failures remain failures and are covered by tests.
  • Access policy prevents an unbound agent/workflow from enumerating or reading a server's resources/prompts.

Current implementation evidence

Related

  • #1661 tracks managed Bearer authentication for remote Streamable HTTP MCP servers. Authentication and resources/prompts are complementary: neither should bypass the other's security policy.
  • https://github.com/abhigyanpatwari/GitNexus/pull/3097 documents the current compatibility boundary.