get_project
Retrieve JIRA project details by providing the project key to access essential information for project management and tracking.
Instructions
获取JIRA项目详情
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_key | Yes |
Implementation Reference
- src/jira_mcp/server.py:422-451 (handler)The handler implementation for the 'get_project' tool. This function is decorated with @mcp.tool, takes a project_key parameter, retrieves the JIRA client, fetches the project details, and returns them as a dictionary or an error message.@mcp.tool( description="获取JIRA项目详情", ) 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:39-46 (helper)Helper function that creates and caches a JIRA client instance using settings from config. Called within the get_project handler.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
- src/jira_mcp/server.py:792-792 (registration)The mcp.run() call in main() that starts the MCP server and registers all @mcp.tool decorated functions, including get_project.mcp.run(transport=args.transport)
- src/jira_mcp/server.py:21-21 (helper)Initialization of the FastMCP server instance which handles tool registration via decorators.mcp = FastMCP("JIRA MCP Server", port=int(os.getenv("MCP_SERVER_PORT", "8000")))