AWS Security ChangesHomeSearch

AWS emr: Spark agents MCP setup: dedicated IAM role and profile guidance

Service: emr · 2026-11-19 · Documentation medium

File: emr/latest/ReleaseGuide/spark-troubleshooting-agent-setup.md · Type: iam

Summary

Rewrites the MCP client setup for the EMR Spark troubleshooting/optimization agents: adds steps to create a dedicated AWS profile that assumes a role (aws configure set profile.smus-mcp-profile.role_arn/source_profile/region), replaces the 'default' profile in all example commands and JSON config with 'smus-mcp-profile', adds Claude Code and Codex client instructions, and links to new IAM permissions and fine-grained/dedicated-role guidance pages.

Security assessment

The change is documentation-only but security-adjacent: it steers users away from the broad 'default' profile toward a dedicated profile that assumes a scoped IAM role, and explicitly points to least-privilege/fine-grained permission and dedicated-role guidance. This reduces the blast radius of the credentials the MCP agents use, but it does not fix a specific vulnerability or incident, so it is hardening guidance rather than a security fix.

Evidence

+If you want tighter, scoped control over what the agents can access, see [How can I get more fine-grained control over the agents' permissions?](./spark-troubleshooting-agent-iam-setup.html#qa-fine-grained-permissions). To give the agents their own role, see [How do I create a dedicated IAM role for the agents?](./spark-troubleshooting-agent-iam-setup.html#qa-dedicated-role).

Diff

diff --git a/emr/latest/ReleaseGuide/spark-troubleshooting-agent-setup.md b/emr/latest/ReleaseGuide/spark-troubleshooting-agent-setup.md
index c1924ca..9421572 100644
--- a//emr/latest/ReleaseGuide/spark-troubleshooting-agent-setup.md
+++ b//emr/latest/ReleaseGuide/spark-troubleshooting-agent-setup.md
@@ -17 +17 @@ Note
-Both agents use the `sagemaker-unified-studio-mcp-troubleshooting` server and the `/spark-troubleshooting/mcp` endpoint, despite "troubleshooting" in the names. Only the Troubleshooting Agent uses the code recommendation server, `sagemaker-unified-studio-mcp-code-rec` (`/spark-code-recommendation/mcp`). If you use only the Optimization Agent, you can skip it.
+Both agents use the `sagemaker-unified-studio-mcp-troubleshooting` server and the `/spark-troubleshooting/mcp` endpoint, despite "troubleshooting" in the names. Both agents use the same setup. If you've already set up one agent, you can use the other on the same platforms without additional setup. Only the troubleshooting agent uses the code recommendation server, `sagemaker-unified-studio-mcp-code-rec` (`/spark-code-recommendation/mcp`). If you use only the optimization agent, you can skip it.
@@ -40 +40 @@ The MCP server authorizes operations at the AWS service level using the IAM iden
-Point the MCP client at an AWS profile for a role that you already use to analyze your Spark jobs. The agents' access then matches your own. Make sure that the role has the permissions described in [IAM permissions for the Apache Spark agents](./spark-troubleshooting-agent-iam-setup.html), so that the agents can read all the signals from your Spark jobs.
+Point the MCP client at an AWS profile for a role that you already use to analyze your Spark jobs today. The agents' access then matches your own. Make sure that role carries the permissions described in [IAM permissions for the Apache Spark agents](./spark-troubleshooting-agent-iam-setup.html) so the agents can read all the signals from your Spark jobs.
@@ -42 +42 @@ Point the MCP client at an AWS profile for a role that you already use to analyz
-If you want tighter, scoped control over what the agents can access, see [How can I get more fine-grained control over the agents' permissions?](./spark-troubleshooting-agent-troubleshooting.html#spark-agents-qa-fine-grained).
+If you want tighter, scoped control over what the agents can access, see [How can I get more fine-grained control over the agents' permissions?](./spark-troubleshooting-agent-iam-setup.html#qa-fine-grained-permissions). To give the agents their own role, see [How do I create a dedicated IAM role for the agents?](./spark-troubleshooting-agent-iam-setup.html#qa-dedicated-role).
@@ -46 +46,10 @@ If you want tighter, scoped control over what the agents can access, see [How ca
-To set your Region and add the MCP servers, run the following commands. Point `--profile` at the profile for the role that you use. This example uses the `default` profile. Replace it with your own.
+The agents use the AWS profile that you pass to the MCP servers. Use a profile for a role you already have. If your default profile already uses that role, use it. Otherwise, create a profile that assumes the role, replacing `your-role-name` with your role's name:
+    
+    
+    aws configure set profile.smus-mcp-profile.role_arn arn:aws:iam::111122223333:role/your-role-name
+    aws configure set profile.smus-mcp-profile.source_profile default
+    aws configure set profile.smus-mcp-profile.region <your mcp server launch region>
+
+For the permissions the role needs, see [IAM permissions for the Apache Spark agents](./spark-troubleshooting-agent-iam-setup.html).
+
+To set your Region and add the MCP servers, run the following commands. Point `--profile` at the profile for the role you use. This example uses the `smus-mcp-profile` profile from the previous step. If you use a different profile, replace it.
@@ -51 +60 @@ To set your Region and add the MCP servers, run the following commands. Point `-
-    # Add Spark Troubleshooting MCP Server
+    # Add Spark Troubleshooting and Optimization MCP Server
@@ -55 +64 @@ To set your Region and add the MCP servers, run the following commands. Point `-
-        --args "[\"mcp-proxy-for-aws@latest\",\"https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-troubleshooting/mcp\", \"--service\", \"sagemaker-unified-studio-mcp\", \"--profile\", \"default\", \"--region\", \"${SMUS_MCP_REGION}\", \"--read-timeout\", \"180\"]" \
+        --args "[\"mcp-proxy-for-aws@latest\",\"https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-troubleshooting/mcp\", \"--service\", \"sagemaker-unified-studio-mcp\", \"--profile\", \"smus-mcp-profile\", \"--region\", \"${SMUS_MCP_REGION}\", \"--read-timeout\", \"180\"]" \
@@ -58,0 +68,10 @@ To set your Region and add the MCP servers, run the following commands. Point `-
+    # If you use Claude Code, use the following command instead
+    # claude mcp add --scope user \
+    #     sagemaker-unified-studio-mcp-troubleshooting \
+    #  -- uvx mcp-proxy-for-aws@latest \
+    #     https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-troubleshooting/mcp \
+    #     --service sagemaker-unified-studio-mcp \
+    #     --profile smus-mcp-profile \
+    #     --region ${SMUS_MCP_REGION} \
+    #     --read-timeout 180
+    
@@ -63 +82 @@ To set your Region and add the MCP servers, run the following commands. Point `-
-        --args "[\"mcp-proxy-for-aws@latest\",\"https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-code-recommendation/mcp\", \"--service\", \"sagemaker-unified-studio-mcp\", \"--profile\", \"default\", \"--region\", \"${SMUS_MCP_REGION}\", \"--read-timeout\", \"180\"]" \
+        --args "[\"mcp-proxy-for-aws@latest\",\"https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-code-recommendation/mcp\", \"--service\", \"sagemaker-unified-studio-mcp\", \"--profile\", \"smus-mcp-profile\", \"--region\", \"${SMUS_MCP_REGION}\", \"--read-timeout\", \"180\"]" \
@@ -67 +86,11 @@ To set your Region and add the MCP servers, run the following commands. Point `-
-This updates `~/.kiro/settings/mcp.json` to include the MCP server configuration as follows.
+    # If you use Claude Code, use the following command instead
+    # claude mcp add --scope user \
+    #     sagemaker-unified-studio-mcp-code-rec \
+    #  -- uvx mcp-proxy-for-aws@latest \
+    #     https://sagemaker-unified-studio-mcp.${SMUS_MCP_REGION}.api.aws/spark-code-recommendation/mcp \
+    #     --service sagemaker-unified-studio-mcp \
+    #     --profile smus-mcp-profile \
+    #     --region ${SMUS_MCP_REGION} \
+    #     --read-timeout 180
+
+This updates `~/.kiro/settings/mcp.json` to include the MCP server configuration as follows. If you use Claude Code, the command updates `~/.claude.json` instead.
@@ -81 +110 @@ This updates `~/.kiro/settings/mcp.json` to include the MCP server configuration
-            "default",
+            "smus-mcp-profile",
@@ -99 +128 @@ This updates `~/.kiro/settings/mcp.json` to include the MCP server configuration
-            "default",
+            "smus-mcp-profile",
@@ -115,2 +143,0 @@ You can also use the preceding configuration in other MCP clients and IDEs to co
-  * **Integration with Cline** – To use the MCP server with Cline, modify `cline_mcp_settings.json` and add the MCP server configuration shown earlier. For more information about how to manage MCP configuration, see the [Cline documentation](https://docs.cline.bot/mcp/configuring-mcp-servers).
-
@@ -118,0 +146,4 @@ You can also use the preceding configuration in other MCP clients and IDEs to co
+  * **Integration with Codex** – To use the MCP server with Codex, add the MCP server configuration shown earlier to your Codex configuration file (`~/.codex/config.toml`), in Codex's TOML format. For more information, see [Model Context Protocol](https://developers.openai.com/codex/mcp) in the Codex documentation.
+
+  * **Integration with Cline** – To use the MCP server with Cline, modify `cline_mcp_settings.json` and add the MCP server configuration shown earlier. For more information about how to manage MCP configuration, see the [Cline documentation](https://docs.cline.bot/mcp/configuring-mcp-servers).
+