You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/render/mcp.md
+84-1Lines changed: 84 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,4 +116,87 @@ The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) is a web-
116
116
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.
117
117
118
118
***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:
0 commit comments