[Question] Connect to mcp-remote server
To setup connection to the Atlassian Remote MCP Server beta, you can use the following configuration -
{
"mcpServers": {
"atlassian": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.atlassian.com/v1/sse"]
}
}
}
Please someone guide me to use with MCPToolset
Hi @dttran-glo,
I have tried to implement this same case for a project I am working on, here are some things that have worked for me and you could try:
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioServerParameters
jira_tool = MCPToolset(
connection_params=StdioServerParameters(
command='npx',
args=[
"-y", "mcp-remote", "https://mcp.atlassian.com/v1/sse",
"--jira-url=https://your-project.atlassian.net",
"[email protected]",
"--jira-token=your_token"
],
env={}
)
)
You can obtain the token from this option https://id.atlassian.com/manage-profile/security/api-tokens
With this you could run the agent passing the previous tool.
If you need access to confluence as well, you can add these flags
"--confluence-url", "https://your-company.atlassian.net/wiki", "--confluence-username", "[email protected]", "--confluence-token", "your_api_token"
Timeout error
If during the agent startup you get a timeout error, after investigating I see that it is because an authorization error, something that worked for me was to run the following command in the terminal
npx -y mcp-remote https://mcp.atlassian.com/v1/sse --jira-url=https://your-project.atlassian.net/ --jira-username=[[email protected]](mailto:[email protected]) --jira-token=YOUR_TOKEN
This will open a window in the browser in which Jira requests permissions, just accept and you will be able to run the agent again.
cloudid error
Probably, when the agent makes the first interaction with the Jira MCP it will tell you that it needs the cloudId of the project in Jira, you can tell it to use the #getAccessibleAtlassianResources tool to get the cloudId and give it to you, then you can set the cloudId in the prompt or give it the instruction on how to get the cloudId. After this the agent could interact with the MCP without any problem.
What's next
After some tests I find that the authorization that was accepted to solve the timeout error is temporary, I think it lasts about 1 hour, after that the window to accept the permissions comes up again, this is a problem if you plan to use the agent on a server as in my case, if anyone has any idea how to increase the time or if there is something I am doing wrong, please let me know. 🙌
I have found the right way to handle this, with mcp-remote it automatically manages the session, this is why it opens a tab in the browser and is not really making use of the args that are being sent, if you want to make use of the parameters you send it is best to use uvx, this already manages the session with the token you send --jira-token
jira_tool = MCPToolset(
connection_params=StdioServerParameters(
command='uvx',
args=[
"mcp-atlassian",
"--jira-url=https://your-project.atlassian.net",
"[email protected]",
"--jira-token=your_token"
],
env={}
)
)
@jfolaya8 thank you <3
This seems resolved already, by the content in the thread. If I'm wrong please feel free to reopen.
Is there anyways to use the official server with bearer token stored else where?
You should be able to wire things up using Cloud Secrets or any other third party secret manager. But thats's not wired into the ADK api at the moment.