Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Ram Mehta
December 20, 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.executableargs=[
             "-m""mcp_server_jira",
             "--jira-base-url"JIRA_URL,
             "--jira-token"JIRA_API_TOKEN ] )
   
    async with stdio_client(server_paramsas (readwrite):
        async with ClientSession(readwriteas 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.

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events