@@ -7,6 +7,7 @@ AgentCore projects use JSON configuration files in the `agentcore/` directory.
77| File | Purpose |
88| --------------------- | ------------------------------------------- |
99| ` agentcore.json ` | Project, agents, memories, and credentials |
10+ | ` mcp.json ` | Gateways, gateway targets, and MCP tools |
1011| ` aws-targets.json ` | Deployment targets |
1112| ` deployed-state.json ` | Runtime state (auto-managed, do not edit) |
1213| ` .env.local ` | API keys for local development (gitignored) |
@@ -43,6 +44,12 @@ Main project configuration using a **flat resource model**. Agents, memories, an
4344 {
4445 "type" : " ApiKeyCredentialProvider" ,
4546 "name" : " OpenAI"
47+ },
48+ {
49+ "type" : " OAuthCredentialProvider" ,
50+ "name" : " MyOAuthProvider" ,
51+ "discoveryUrl" : " https://idp.example.com/.well-known/openid-configuration" ,
52+ "scopes" : [" read" , " write" ]
4653 }
4754 ]
4855}
@@ -56,7 +63,9 @@ Main project configuration using a **flat resource model**. Agents, memories, an
5663| ` version ` | Yes | Schema version (integer, currently ` 1 ` ) |
5764| ` agents ` | Yes | Array of agent specifications |
5865| ` memories ` | Yes | Array of memory resources |
59- | ` credentials ` | Yes | Array of credential providers |
66+ | ` credentials ` | Yes | Array of credential providers (API key or OAuth) |
67+
68+ > Gateway configuration is stored separately in ` mcp.json ` . See [ mcp.json] ( #mcpjson ) below.
6069
6170---
6271
@@ -142,6 +151,8 @@ Strategy configuration:
142151
143152## Credential Resource
144153
154+ ### API Key Credential
155+
145156``` json
146157{
147158 "type" : " ApiKeyCredentialProvider" ,
@@ -154,8 +165,142 @@ Strategy configuration:
154165| ` type ` | Yes | Always ` "ApiKeyCredentialProvider" ` |
155166| ` name ` | Yes | Credential name (3-255 chars) |
156167
157- The actual API key is stored in ` .env.local ` for local development and in AgentCore Identity service for deployed
158- environments.
168+ ### OAuth Credential
169+
170+ ``` json
171+ {
172+ "type" : " OAuthCredentialProvider" ,
173+ "name" : " MyOAuthProvider" ,
174+ "discoveryUrl" : " https://idp.example.com/.well-known/openid-configuration" ,
175+ "scopes" : [" read" , " write" ]
176+ }
177+ ```
178+
179+ | Field | Required | Description |
180+ | -------------- | -------- | ------------------------------------------------------ |
181+ | ` type ` | Yes | Always ` "OAuthCredentialProvider" ` |
182+ | ` name ` | Yes | Credential name (3-255 chars) |
183+ | ` discoveryUrl ` | Yes | OIDC discovery URL (must be a valid URL) |
184+ | ` scopes ` | No | Array of OAuth scopes |
185+ | ` vendor ` | No | Credential provider vendor (default: ` "CustomOauth2" ` ) |
186+ | ` managed ` | No | Whether auto-created by the CLI (do not edit) |
187+ | ` usage ` | No | ` "inbound" ` or ` "outbound" ` |
188+
189+ The actual secrets (API keys, client IDs, client secrets) are stored in ` .env.local ` for local development and in
190+ AgentCore Identity service for deployed environments.
191+
192+ ---
193+
194+ ## mcp.json
195+
196+ Gateway and MCP tool configuration. Gateways, their targets, and standalone MCP runtime tools are defined here.
197+
198+ ``` json
199+ {
200+ "agentCoreGateways" : [
201+ {
202+ "name" : " MyGateway" ,
203+ "description" : " My gateway" ,
204+ "authorizerType" : " NONE" ,
205+ "targets" : [
206+ {
207+ "name" : " WeatherTools" ,
208+ "targetType" : " mcpServer" ,
209+ "endpoint" : " https://mcp.example.com/mcp"
210+ }
211+ ]
212+ }
213+ ],
214+ "unassignedTargets" : []
215+ }
216+ ```
217+
218+ ### Top-Level Fields
219+
220+ | Field | Required | Description |
221+ | ------------------- | -------- | ------------------------------------- |
222+ | ` agentCoreGateways ` | Yes | Array of gateway definitions |
223+ | ` unassignedTargets ` | No | Targets not yet assigned to a gateway |
224+
225+ ### Gateway
226+
227+ | Field | Required | Description |
228+ | ------------------------- | -------- | ------------------------------------------------------------ |
229+ | ` name ` | Yes | Gateway name (alphanumeric, hyphens, 1-63 chars) |
230+ | ` description ` | No | Gateway description |
231+ | ` targets ` | Yes | Array of gateway targets |
232+ | ` authorizerType ` | No | ` "NONE" ` (default), ` "AWS_IAM" ` , or ` "CUSTOM_JWT" ` |
233+ | ` authorizerConfiguration ` | No | Required when ` authorizerType ` is ` "CUSTOM_JWT" ` (see below) |
234+
235+ ### CUSTOM_JWT Authorizer Configuration
236+
237+ ``` json
238+ {
239+ "authorizerType" : " CUSTOM_JWT" ,
240+ "authorizerConfiguration" : {
241+ "customJwtAuthorizer" : {
242+ "discoveryUrl" : " https://idp.example.com/.well-known/openid-configuration" ,
243+ "allowedAudience" : [" my-api" ],
244+ "allowedClients" : [" my-client-id" ],
245+ "allowedScopes" : [" read" , " write" ]
246+ }
247+ }
248+ }
249+ ```
250+
251+ | Field | Required | Description |
252+ | ----------------- | -------- | ---------------------------------------------------------------------- |
253+ | ` discoveryUrl ` | Yes | OIDC discovery URL (must end with ` /.well-known/openid-configuration ` ) |
254+ | ` allowedAudience ` | Yes | Array of allowed audience values |
255+ | ` allowedClients ` | Yes | Array of allowed client IDs (at least 1) |
256+ | ` allowedScopes ` | No | Array of allowed scopes |
257+
258+ ### Gateway Target
259+
260+ A target is a backend tool exposed through a gateway. Targets can be external MCP server endpoints or compute-backed
261+ implementations.
262+
263+ ** External MCP server endpoint:**
264+
265+ ``` json
266+ {
267+ "name" : " WeatherTools" ,
268+ "targetType" : " mcpServer" ,
269+ "endpoint" : " https://mcp.example.com/mcp"
270+ }
271+ ```
272+
273+ ** External endpoint with outbound auth:**
274+
275+ ``` json
276+ {
277+ "name" : " SecureTools" ,
278+ "targetType" : " mcpServer" ,
279+ "endpoint" : " https://api.example.com/mcp" ,
280+ "outboundAuth" : {
281+ "type" : " OAUTH" ,
282+ "credentialName" : " MyOAuthProvider" ,
283+ "scopes" : [" tools:read" ]
284+ }
285+ }
286+ ```
287+
288+ | Field | Required | Description |
289+ | ----------------- | -------- | -------------------------------------------------------------------- |
290+ | ` name ` | Yes | Target name |
291+ | ` targetType ` | Yes | ` "mcpServer" ` or ` "lambda" ` |
292+ | ` endpoint ` | Cond. | MCP server URL (required for external ` mcpServer ` targets) |
293+ | ` compute ` | Cond. | Compute configuration (required for ` lambda ` and scaffolded targets) |
294+ | ` toolDefinitions ` | Cond. | Array of tool definitions (required for ` lambda ` targets) |
295+ | ` outboundAuth ` | No | Outbound authentication configuration |
296+
297+ ### Outbound Auth
298+
299+ | Field | Required | Description |
300+ | ---------------- | -------- | ---------------------------------------------------- |
301+ | ` type ` | Yes | ` "OAUTH" ` , ` "API_KEY" ` , or ` "NONE" ` (default) |
302+ | ` credentialName ` | Cond. | Credential name (required when type is not ` "NONE" ` ) |
303+ | ` scopes ` | No | OAuth scopes (for ` "OAUTH" ` type) |
159304
160305---
161306
@@ -190,12 +335,17 @@ current list.
190335
191336## .env.local
192337
193- API keys for local development. This file is gitignored.
338+ Secrets for local development. This file is gitignored.
194339
195340``` bash
341+ # API key credentials
196342AGENTCORE_CREDENTIAL_{projectName}OPENAI=sk-...
197343AGENTCORE_CREDENTIAL_{projectName}ANTHROPIC=sk-ant-...
198344AGENTCORE_CREDENTIAL_{projectName}GEMINI=...
345+
346+ # OAuth credentials
347+ AGENTCORE_CREDENTIAL_{projectName}{credentialName}_CLIENT_ID=my-client-id
348+ AGENTCORE_CREDENTIAL_{projectName}{credentialName}_CLIENT_SECRET=my-client-secret
199349```
200350
201351Environment variable names should match the credential names in your configuration.
0 commit comments