get_projects
Retrieve a list of JIRA projects to view and manage work items through the Personal JIRA MCP server interface.
Instructions
获取JIRA项目列表
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/jira_mcp/server.py:392-420 (handler)The get_projects tool handler function decorated with @mcp.tool, which registers it and implements fetching JIRA projects list using the JIRA client, formatting them into a list of dictionaries with id, key, name, and lead.@mcp.tool( description="获取JIRA项目列表", ) def get_projects() -> Dict[str, Any]: """获取所有项目列表. Returns: Dict[str, Any]: 项目列表 """ logger.info("获取项目列表") try: client = get_jira_client() projects = client.projects() result = [ { "id": project.id, "key": project.key, "name": project.name, "lead": getattr(project, "lead", {}).get("displayName", ""), } for project in projects ] return {"projects": result} except Exception as e: logger.error(f"获取项目列表失败: {str(e)}") return {"error": str(e)}