Commit 7cdf77ac authored by MD. SHAHIDUL ISLAM's avatar MD. SHAHIDUL ISLAM

feat: Add `get_all_projects` tool to list Jira projects and introduce a…

feat: Add `get_all_projects` tool to list Jira projects and introduce a comprehensive README for server documentation.
parent fd65f80d
...@@ -169,6 +169,22 @@ def search_issues(jql_query: str) -> str: ...@@ -169,6 +169,22 @@ def search_issues(jql_query: str) -> str:
except Exception as e: except Exception as e:
return f"Error searching issues: {str(e)}" return f"Error searching issues: {str(e)}"
@mcp.tool()
def get_all_projects() -> str:
"""Fetches a list of all Jira projects available to the authenticated user."""
jira = _get_jira()
try:
projects = jira.projects()
if not projects:
return "No projects found."
result = [f"Found {len(projects)} projects:"]
for project in projects:
result.append(f"- {project.name} (Key: {project.key})")
return "\n".join(result)
except Exception as e:
return f"Error fetching projects: {str(e)}"
if __name__ == "__main__": if __name__ == "__main__":
# Start the FastMCP server # Start the FastMCP server
mcp.run() mcp.run()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment