Skip to content

Commit 8334ceb

Browse files
committed
docs: update MCP docs to describe the MCP template features
1 parent 12ebcc3 commit 8334ceb

File tree

1 file changed

+84
-1
lines changed

1 file changed

+84
-1
lines changed

docs/render/mcp.md

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,87 @@ The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) is a web-
116116
To interact with your new MCP server using natural language, you can configure an AI assistant to use it as a tool source. Assistants like the [Gemini CLI](https://github.com/google-gemini/gemini-cli) and the [Claude AI Desktop App](https://claude.ai/download) can connect to remote MCP servers.
117117

118118
* **Claude:** [Connecting to a remote MCP server](https://modelcontextprotocol.io/docs/develop/connect-remote-servers#connecting-to-a-remote-mcp-server)
119-
* **Gemini CLI:** [How to set up your MCP server](https://google-gemini.github.io/gemini-cli/docs/tools/mcp-server.html#how-to-set-up-your-mcp-server)
119+
* **Gemini CLI:** [How to set up your MCP server](https://google-gemini.github.io/gemini-cli/docs/tools/mcp-server.html#how-to-set-up-your-mcp-server)
120+
121+
122+
## Template Features
123+
124+
The baseline [MCP template](https'://github.com/apigee/apigee-go-gen/blob/main/examples/templates/mcp/apiproxy.yaml) automatically
125+
generates an Apigee API proxy that acts as a bridge, allowing Large Language Models (LLMs) to securely interact with
126+
existing REST APIs. The generated proxy handles the translation between the MCP format and standard REST API conventions.
127+
128+
---
129+
130+
### Automated Tool Mapping
131+
132+
The template parses a source **OpenAPI Description** to expose API endpoints as **MCP tools**. Every defined operation
133+
(e.g., `GET /users`, `POST /products`) is automatically made available for an LLM to discover and call. 🗣️
134+
135+
The generated `tools/list` response provides a comprehensive definition for each tool, which includes:
136+
137+
* **`inputSchema`**: Defines the required inputs for the tool, mapped from the API's request parameters.
138+
* **`outputSchema`**: Defines the expected output structure, mapped directly from the response schema in the **OpenAPI Description**.
139+
140+
Additionally, the proxy supports emitting **`structuredContent`** in the `tools/call` response. When the backend REST API
141+
returns a JSON payload (`application/json`), the proxy automatically includes it as structured data, allowing the LLM to
142+
parse the output directly without needing to interpret raw text.
143+
144+
---
145+
146+
### Parameter Mapping
147+
148+
API request parameters are automatically mapped from the MCP tool's input schema to the backend REST request.
149+
The proxy ensures data from the LLM is correctly placed in the corresponding location for the target API. This includes:
150+
151+
* **Query Parameters**
152+
* **Header Values**
153+
* **Path Variables**
154+
* **Request Body Content**
155+
156+
This seamless mapping enables the LLM to provide data for the API without needing to conform to the underlying REST structure.
157+
158+
---
159+
160+
### Transcoding
161+
162+
A core function of the proxy is **transcoding** requests. All MCP tool calls arrive in a standardized **JSON-RPC** format.
163+
The API proxy automatically unwraps this payload and transforms it into a conventional REST API request that the backend
164+
service can understand. 🤖➡️🌐
165+
166+
This process includes:
167+
168+
* **Unwrapping the Payload**: Extracting the target operation, parameters, and body from the incoming JSON-RPC request.
169+
* **Setting HTTP Headers**: Automatically setting necessary headers, such as `Content-Type` and `Accept`, based on the **OpenAPI Description**.
170+
* **Constructing the HTTP Request**: Assembling the final `GET`, `POST`, `PUT`, etc., request with the correct URL, headers, and body.
171+
172+
---
173+
174+
### Request Body Formats
175+
176+
The template provides out-of-the-box support for backend APIs that consume either JSON or XML, handling the necessary
177+
transformations automatically.
178+
179+
* **`application/json`**: For JSON-based backends, the request body is simply unwrapped from the MCP tool input and passed through.
180+
* **`application/xml`**: For XML-based backends, the proxy performs a two-step process:
181+
1. It unwraps the JSON data from the MCP request.
182+
2. It transforms that JSON data into the correct XML format, using the schema defined in your **OpenAPI Description** to ensure validity.
183+
184+
---
185+
186+
### Security
187+
188+
If the **OpenAPI Description** defines a security requirement of type `oath2` or `openIdConnect`, the generated API proxy includes a discovery endpoint to support the OAuth flow. 🔐
189+
190+
This endpoint serves the **Protected Resource Metadata** as required by the MCP specification.
191+
192+
The metadata endpoint is exposed at the following path:
193+
194+
`/.well-known/oauth-protected-resource{mcp_server_basepath}`
195+
196+
!!! Note
197+
198+
It's crucial to understand that **the generated proxy does not act as an authorization server**.
199+
Instead, this metadata simply informs the MCP client where to find the actual OAuth authorization server.
200+
201+
Additionally, whether dynamic client registration is supported is determined by the capabilities of the authorization
202+
server itself, not the Apigee MCP API proxy.

0 commit comments

Comments
 (0)