Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Rovo
  • Questions
  • Running a python code to connect to JIRA mcp server getting error : "'str' object has no attribute '

Running a python code to connect to JIRA mcp server getting error : "'str' object has no attribute '

Ram Mehta
December 19, 2025

Getting below error :

"'str' object has no attribute 'message'"

For the code piece :

async def run_jira_query():
    # 1. Define how to launch the Jira MCP server # We use 'uvx' to run the server executable.
    # # If you pip installed it, you might use 'python', '-m', 'mcp_server_jira' instead.
    server_params = StdioServerParameters(
         command= sys.executable, args=[
             "-m", "mcp_server_jira",
             "--jira-base-url", JIRA_URL,
             "--jira-token", JIRA_API_TOKEN ] )
   
    async with stdio_client(server_params) as (read, write):
        async with ClientSession(read, write) as session:
            # 3. Initialize the session
            await session.initialize()
           
            # Optional: List available tools to see what you can call
            tools = await session.list_tools()
            tool_names = [t.name for t in tools.tools]
            print(f"Connected! Available tools: {tool_names}")

            # 4. Call the 'search_issues' tool
            # Check which tool name is available (some versions use 'jira_search', others 'search_issues')
            tool_name = "get_issue" if "get_issue" in tool_names else "get_issue"
           
            jql_query = "assignee = currentUser() ORDER BY created DESC"
           
            print(f"Executing JQL: {jql_query} using tool '{tool_name}'...")
           
            result = await session.call_tool(
                tool_name,
                arguments={"issue_key": "AS-60387"}
            )

            # 5. Process the result
            for content in result.content:
                if content.type == "text":
                    print("\n--- Jira Results ---")
                    print(result)
I am able to connect successfully and get the list of the available tools as well.

1 answer

1 accepted

0 votes
Answer accepted
Tomislav Tobijas
Community Champion
December 20, 2025

Hi @Ram Mehta ,

I'm going to move this to Rovo forum group. There's also a dedicated discussion forum group for Atlassian Rovo MCP Server.

From what I managed to dig out, potentially the error occurs when handling the result or an exception from session.call_tool(...)

What you could check is:

  • In modern Python, exceptions do not have a .message attribute by default. Instead, you should use str(e) or e.args[0] to get the error message from an exception object.

  • If you have any code like except Exception as e: print(e.message), change it to print(str(e)).

I'm no expert on this, so if anyone's got a smarter idea on what to check, feel free to chime in.

Apart from that, you could try to check with Developer community and see if they can help out (as most folk there are working with things like this).

Cheers,
Tobi

Ram Mehta
December 20, 2025

There's no error returned, I also had this piece of code in the Try Catch block.. but it did not return any error.

Just the object is coming as blank.

Tomislav Tobijas
Community Champion
December 21, 2025

I see you posted this here as well https://community.atlassian.com/forums/Atlassian-Remote-MCP-Server/Running-a-python-code-to-connect-to-JIRA-mcp-server-getting/td-p/3166929, so I would suggest picking up there.

Hopefully someone will chime in and help you troubleshoot this, as it's really not my area of expertise. 🤞

Dr Valeri Colon _Connect Centric_
Community Champion
February 9, 2026

@Ram Mehta  I'll add...that error usually means session.call_tool() is raising/returning a string error payload, and your client code (or the MCP lib) expects an object with a .message field (what @Tomislav Tobijas mentioned). Common causes: wrong argument shape, tool name mismatch, or server returning a plain-text error.

Quick fixes to try:

  • Don’t compute tool_name like this (it always picks get_issue). Confirm the exact tool name from list_tools() and use it.

  • Print the raw result and handle non-standard errors:

    try: result = await session.call_tool(tool_name, arguments={"issue_key":"AS-60387"}) except Exception as e: print("call_tool error:", repr(e)) return print("raw result:", result)
  • Double-check the tool’s required argument key (some use issueKey or key, not issue_key).

 

Like Tomislav Tobijas likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events