[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_impactandgenerate_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:
- Extend the transport service to call
ClientSession.list_resources,read_resource,list_prompts, andget_prompton the already initialized Streamable HTTP/SSE session. - 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.
- Keep server selection and transport negotiation identical to tool listing/calls, including the same URL, blacklist, loopback, and future credential resolution policies.
- Treat resource URIs as opaque MCP identifiers after the server session is established; never fetch a resource URI as an arbitrary HTTP URL.
- Add bounded response sizes, cursor/page limits, timeouts, and explicit truncation/error metadata. Do not auto-read every advertised resource into model context.
- 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.
- Preserve MCP content types and errors; unsupported content must remain explicit instead of being silently dropped.
Acceptance fixture
Pin:
iflytek/astron-agent@aaef2a286b9fb8396d42d5d4f6bb7af9b19afa22abhigyanpatwari/GitNexus@4e51213c82249d5c235f8535d8292bd56de8c01a
Using a controlled GitNexus MCP test server (or an in-process protocol fixture):
-
list_resourcesreturnsgitnexus://reposand repository-scoped resource templates/metadata with pagination preserved. -
read_resourcereads a bounded known resource such as repository context and returns its real MIME/content type. -
list_promptsreturnsdetect_impactandgenerate_mapwith their argument schemas. -
get_promptpreserves 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
- Astron MCP request schemas expose tools only: https://github.com/iflytek/astron-agent/blob/aaef2a286b9fb8396d42d5d4f6bb7af9b19afa22/core/plugin/link/api/schemas/community/tools/mcp/mcp_tools_schema.py
- Astron service calls
list_tools/call_toolonly: https://github.com/iflytek/astron-agent/blob/aaef2a286b9fb8396d42d5d4f6bb7af9b19afa22/core/plugin/link/service/community/tools/mcp/mcp_server.py - Shared transport/session initialization: https://github.com/iflytek/astron-agent/blob/aaef2a286b9fb8396d42d5d4f6bb7af9b19afa22/core/plugin/link/service/community/tools/mcp/mcp_transport.py
- GitNexus MCP resources: https://github.com/abhigyanpatwari/GitNexus/blob/4e51213c82249d5c235f8535d8292bd56de8c01a/gitnexus/src/mcp/resources.ts
- GitNexus MCP prompts/tools registration: https://github.com/abhigyanpatwari/GitNexus/blob/4e51213c82249d5c235f8535d8292bd56de8c01a/gitnexus/src/mcp/server.ts
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.
Source: iflytek/astron-agent