from mcp.server.fastmcp import Context
from mcp_jenkins.server import client, mcp
@mcp.tool(tag='read')
async def get_all_nodes(ctx: Context) -> list[dict]:
"""
Get all nodes from Jenkins
Returns:
list[dict]: A list of all nodes
"""
return [node.model_dump(exclude_none=True) for node in client(ctx).node.get_all_nodes()]
@mcp.tool(tag='read')
async def get_node_config(ctx: Context, name: str) -> str:
"""
Get node config from Jenkins
Args:
name: The name of the node
Returns:
str: The config of the node
"""
return client(ctx).node.get_node_config(name)
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lanbaoshen/mcp-jenkins'
If you have feedback or need assistance with the MCP directory API, please join our Discord server