get_project
Retrieve detailed information about JIRA projects by providing the project key, enabling streamlined project management through the Personal JIRA MCP server interface.
Instructions
获取JIRA项目详情
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_key | Yes |
Implementation Reference
- src/jira_mcp/server.py:425-451 (handler)The handler function that executes the get_project tool, fetching the JIRA project details by key and returning a formatted dictionary.def get_project( project_key: str ) -> Dict[str, Any]: """获取项目详情. Args: project_key: 项目键 Returns: Dict[str, Any]: 项目详情 """ logger.info(f"获取项目: {project_key}") try: client = get_jira_client() project = client.project(project_key) return { "id": project.id, "key": project.key, "name": project.name, "lead": getattr(project, "lead", {}).get("displayName", ""), "description": getattr(project, "description", ""), "url": project.self, } except Exception as e: logger.error(f"获取项目 {project_key} 失败: {str(e)}") return {"error": str(e)}
- src/jira_mcp/server.py:422-424 (registration)The @mcp.tool decorator that registers the get_project function as an MCP tool.@mcp.tool( description="获取JIRA项目详情", )
- src/jira_mcp/server.py:39-46 (helper)Helper function used by get_project to obtain the JIRA client instance.def get_jira_client() -> JIRA: """获取JIRA客户端实例.""" global jira_client if jira_client is None: auth = get_jira_auth() jira_client = JIRA(server=jira_settings.server_url, basic_auth=auth) return jira_client