Describe attachment uploads, reads, room message descriptors and the larger-file HTTP endpoint in MCP discovery and llms.txt.
- commit
- 7a2a81a0b9cc0529ed52e46bd655f16740ed3445
- parent
- c1c6760aef409dc4ff11513e1f920763830cd1f8
- author
- Dami <dami.etoile@gmail.com>
| M | internal/ | 7 | +++++-- |
@@ -20,7 +20,7 @@ func (t *Tenant) initMCP() error {
2020 t.mcp = &mcp.Server{2121 Tools: tools,2222 Info: mcp.Implementation{Name: "tinyrelay", Version: t.app.cfg.Version},23- Instructions: "This relay hosts Nostr events, files, Git repositories, chat rooms and a wiki, and admits agents under signed grants. Read tools return the data your key may see; management tools, including the agent controls, follow the relay's roles. Write tools accept a signed Nostr event, or build the unsigned event for you to sign when called with plain fields. request_decision asks a person for an answer that arrives as a kind 7 reaction. request_job asks for a long task; a serving agent answers it with job_feedback and job_result, and list_jobs and read_job follow the work. add_callback registers an https URL that is woken with each new event matching a filter, so an agent that cannot hold a connection open still learns of new issues, pushes, room messages and requests.",23+ Instructions: "This relay hosts Nostr events, files, Git repositories, chat rooms and a wiki, and admits agents under signed grants. Read tools return the data your key may see; management tools, including the agent controls, follow the relay's roles. Write tools accept a signed Nostr event, or build the unsigned event for you to sign when called with plain fields. upload_attachment stores a file for a room and returns a descriptor for the attachments argument of post_message, start_thread or reply_in_thread; read_attachment retrieves files your key may read. request_decision asks a person for an answer that arrives as a kind 7 reaction. request_job asks for a long task; a serving agent answers it with job_feedback and job_result, and list_jobs and read_job follow the work. add_callback registers an https URL that is woken with each new event matching a filter, so an agent that cannot hold a connection open still learns of new issues, pushes, room messages and requests.",2424 Authenticate: t.mcpAuthenticate,2525 Challenge: mcpChallenge,2626 Origin: t.mcpOrigin,@@ -91,12 +91,15 @@ func (t *Tenant) llmsHTTP(w http.ResponseWriter, r *http.Request) {
9191 "- Endpoint: "+base+"/mcp accepts POST only. Protocol version "+mcp.Version+", stateless Streamable HTTP, JSON responses.",9292 "- Headers: `MCP-Protocol-Version: "+mcp.Version+"`, `Mcp-Method` equal to the JSON-RPC method and, for tools/call, `Mcp-Name` equal to params.name. The body's params._meta carries `"+mcp.MetaProtocolVersion+"` and `"+mcp.MetaClientCapabilities+"`.",9393 "- Methods: server/discover, tools/list and tools/call.",94- "- Read tools: list_repositories, read_repository, list_issues, read_issue, list_pull_requests, read_pull_request, list_files, read_file, read_status, read_management, list_rooms, read_room, read_thread, list_wiki, read_wiki_page, read_merge_request, list_agents, list_callbacks, list_custom_views, list_join_requests, list_jobs and read_job.",94+ "- Read tools: list_repositories, read_repository, list_issues, read_issue, list_pull_requests, read_pull_request, list_files, read_file, read_attachment, read_status, read_management, list_rooms, read_room, read_thread, list_wiki, read_wiki_page, read_merge_request, list_agents, list_callbacks, list_custom_views, list_join_requests, list_jobs and read_job.",9595 "- Management tools: run_job, add_job, remove_job, backup_now, dump_now, set_policy, set_connections, send_test_notification, pause_agent, resume_agent, revoke_agent, pause_all_agents, resume_all_agents, approve_join, deny_join, add_callback, remove_callback, pause_callback, resume_callback, add_custom_view, remove_custom_view, pause_custom_view, resume_custom_view and run_custom_view. approve_join and deny_join answer access requests from people who asked to join without an invite. A callback POSTs each new matching event to an https URL, signed with X-Tiny-Signature. A custom view POSTs the fenced code blocks of matching events to an https transform and keeps the SVG or PNG it returns as signed artifacts served at /views/<name>/<hash>.svg.",9696 "- Write tools take a signed event, or return the unsigned event to sign when called with plain fields: publish_event, create_issue, create_pull_request, comment, set_status, post_message, start_thread, reply_in_thread, react, publish_wiki_page, propose_wiki_merge, publish_site, create_room, request_decision, request_job, job_feedback and job_result. A decision request is answered by a kind 7 reaction from the person asked; a job request is answered by kind 7000 feedback and a result of the request kind plus 1000. publish_site takes [path, sha256] pairs for files already in the blob store and publishes a NIP-5A manifest; an agent needs a sites grant, and a grant with a ttl requires an expiration tag.",9797 "",9898 "## Files",9999 "",100+ "- Room attachments: upload_attachment takes room, Base64 data, type and an optional filename, with up to 700 KiB of encoded data. Pass its descriptor in attachments to post_message, start_thread or reply_in_thread, sign the returned event and call the write tool again with event. Images, video and audio render inline; other files have download links.",101+ "- Larger room files: PUT "+base+"/rooms/<id>/attachments?filename=<name> accepts raw bytes from 1 byte through 32 MiB with NIP-98 authorization. Returned media URLs and other file download routes enforce room access. Storage quotas and agent grants also apply.",102+ "- read_attachment accepts sha256 and optional max_bytes, up to 4 MiB. It returns Base64 data for every file and native MCP image or audio content where applicable.",100103 "- Blossom: PUT "+base+"/upload stores a file by its SHA-256 with a kind 24242 authorization; GET "+base+"/<sha256> serves it. An agent whose sites grant sets a ttl keeps its uploads for that long unless a person claims them; one whose grant says encrypted may store only encrypted blobs.",101104 "",102105 "## HTTP bridge",