# Chef MCP Server > **Chef MCP Server** is a hosted, multitenant Model Context Protocol (MCP) server run by **MewCP** (https://mewcp.com), giving AI agents managed access to Chef. > > MewCP takes care of all MCP infrastructure for you — credential storage, OAuth flows, > token refresh, and production-grade auto-scaling — so your AI agents can connect to > third-party services and run freely without you managing any MCP server yourself. > > To connect your agent to this server you need a MewCP account and your API key: > - MEWCP_KEY — your personal API key (dashboard → Developer) > > Server page: https://mewcp.com/mcp/chef-server > MewCP docs: https://docs.mewcp.com > Full catalog: https://mewcp.com/llms.txt ## About Manage infrastructure, nodes, cookbooks and configuration workflows through Chef Server. Automate provisioning, configuration management and operational infrastructure tasks. ## How to connect Server Page URL: https://mewcp.com/mcp/chef-server Gateway URL: https://gateway.mewcp.com/personal/mcp Every request to this server requires one header: Authorization: Bearer — your MewCP API key (dashboard → Developer) All connection snippets and ready-to-use code examples are available on the server page and in this document below. --- ## Server documentation # CL Chef Server MCP Server A Model Context Protocol (MCP) server that exposes the Chef Infra Server API for generic, stateless, multi-tenant API operations. ## Overview This MCP is an integration server for Chef Infra Server and follows Curious Layer standards: - Stateless and multi-tenant by design - Per-request authentication (no shared in-memory auth/session state) - Generic API coverage for all Chef Server endpoints via tool calls ## Authentication All tenant-facing tools require authentication input on every call. ### Chef Signature Auth (default) Use this auth payload format in auth_data: ```json { "auth_type": "chef-signature", "user_id": "pivotal", "private_key": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----", "auth_version": "1.3", "chef_version": "18.0.0", "server_api_version": "1" } ``` Notes: - private_key_base64 can be used instead of private_key. - auth_version supports 1.3 (recommended) and 1.0. ### Basic Auth (for endpoints like /_stats) ```json { "auth_type": "basic", "basic_username": "statsuser", "basic_password": "your-password" } ``` ## Tools This server exposes dedicated tools per endpoint functionality (instead of a generic wrapper). - health_check Global endpoint tools: - chef_authenticate_user - chef_get_license - chef_list_organizations_global - chef_create_organization_global - chef_get_organization_global - chef_update_organization_global - chef_delete_organization_global - chef_get_stats - chef_get_status - chef_list_users_global - chef_create_user_global - chef_get_user_global - chef_update_user_global - chef_delete_user_global - chef_list_user_keys_global - chef_create_user_key_global - chef_get_user_key_global - chef_update_user_key_global - chef_delete_user_key_global - chef_get_universe_global Organization endpoint tools: - chef_list_association_requests - chef_create_association_request - chef_delete_association_request - chef_list_clients - chef_create_client - chef_get_client - chef_update_client - chef_delete_client - chef_list_client_keys - chef_create_client_key - chef_get_client_key - chef_update_client_key - chef_delete_client_key - chef_list_containers - chef_create_container - chef_get_container - chef_delete_container - chef_list_cookbook_artifacts - chef_get_cookbook_artifact - chef_get_cookbook_artifact_version - chef_upsert_cookbook_artifact_version - chef_delete_cookbook_artifact_version - chef_list_cookbooks - chef_get_latest_cookbooks - chef_get_latest_recipes - chef_get_cookbook - chef_get_cookbook_version - chef_upsert_cookbook_version - chef_delete_cookbook_version - chef_list_data_bags - chef_create_data_bag - chef_get_data_bag - chef_create_data_bag_item - chef_delete_data_bag - chef_get_data_bag_item - chef_update_data_bag_item - chef_delete_data_bag_item - chef_list_environments - chef_create_environment - chef_get_default_environment - chef_get_environment - chef_update_environment - chef_delete_environment - chef_get_environment_cookbook - chef_resolve_environment_cookbook_versions - chef_list_environment_cookbooks - chef_list_environment_nodes - chef_list_environment_recipes - chef_get_environment_role_run_list - chef_list_groups - chef_create_group - chef_get_group - chef_update_group - chef_delete_group - chef_list_nodes - chef_create_node - chef_get_node - chef_update_node - chef_delete_node - chef_head_node - chef_list_policies - chef_list_policy_groups - chef_get_principal - chef_get_required_recipe - chef_list_roles - chef_create_role - chef_get_role - chef_update_role - chef_delete_role - chef_list_role_environments - chef_get_role_environment - chef_create_sandbox - chef_commit_sandbox - chef_list_search_indexes - chef_search_index - chef_partial_search_index - chef_get_updated_since - chef_list_org_users - chef_associate_org_user - chef_get_org_user - chef_disassociate_org_user ## Setup ```bash pip install -r requirements.txt ``` ## Running the Server ```bash # stdio python server.py # sse python server.py --transport sse --host 127.0.0.1 --port 8001 # streamable-http python server.py --transport streamable-http --host 127.0.0.1 --port 8001 ``` ## Example Tool Calls ### Global endpoint request ```json { "tool": "chef_list_organizations_global", "arguments": { "auth_data": "{\"auth_type\":\"chef-signature\",\"user_id\":\"pivotal\",\"private_key\":\"-----BEGIN RSA PRIVATE KEY-----\\n...\\n-----END RSA PRIVATE KEY-----\"}", "server_url": "https://chef.example.com", "path_params": "{}", "query_params": "{}" } } ``` ### Organization-scoped request ```json { "tool": "chef_list_nodes", "arguments": { "auth_data": "{\"auth_type\":\"chef-signature\",\"user_id\":\"my-client\",\"private_key\":\"-----BEGIN RSA PRIVATE KEY-----\\n...\\n-----END RSA PRIVATE KEY-----\"}", "server_url": "https://chef.example.com", "path_params": "{\"organization\":\"my-org\"}", "query_params": "{}" } } ``` ### Basic auth endpoint request ```json { "tool": "chef_get_stats", "arguments": { "auth_data": "{\"auth_type\":\"basic\",\"basic_username\":\"statsuser\",\"basic_password\":\"secret\"}", "server_url": "https://chef.example.com", "path_params": "{}", "query_params": "{\"format\":\"json\"}" } } ``` ## Project Structure ```text cl-mcp-chef-server/ |-- server.py |-- requirements.txt |-- README.md `-- chef_server_mcp/ |-- __init__.py |-- cli.py |-- config.py |-- tools.py |-- schemas.py `-- service.py ``` ## Resources - Chef Infra Server API docs: https://docs.chef.io/server/api_chef_server/ - FastMCP docs: https://gofastmcp.com/v2/getting-started/welcome --- ## Connection snippets ### Python (fastmcp) ```python import asyncio from fastmcp import Client from fastmcp.client.transports import StreamableHttpTransport SERVER_URL = "https://gateway.mewcp.com/personal/mcp" MEWCP_KEY = "YOUR_MEWCP_KEY" transport = StreamableHttpTransport( url=SERVER_URL, headers={ "Authorization": f"Bearer {MEWCP_KEY}", } ) async def main(): client = Client(transport) async with client: await client.ping() tools = await client.list_tools() resources = await client.list_resources() prompts = await client.list_prompts() # Change the tool name and arguments with actual tool and arguments available in server result = await client.call_tool("example_tool", {"param": "value"}) print(result) asyncio.run(main()) ``` ### TypeScript (MCP SDK) ```typescript import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; const SERVER_URL = "https://gateway.mewcp.com/personal/mcp"; const MEWCP_KEY = "YOUR_MEWCP_KEY"; const transport = new StreamableHTTPClientTransport(new URL(SERVER_URL), { requestInit: { headers: { Authorization: `Bearer ${MEWCP_KEY}`, }, }, }); const client = new Client({ name: "mewcp-client", version: "1.0.0", }); await client.connect(transport); const tools = await client.listTools(); console.log("Available tools:", tools.tools.map(t => t.name)); // Change the tool name and arguments to a tool available on your server const result = await client.callTool({ name: "example_tool", arguments: { param: "value" }, }); console.log("Tool result:", result); ``` ### VS Code (settings.json) ```json { "servers": { "mewcp": { "type": "http", "url": "https://gateway.mewcp.com/personal/mcp", "headers": { "Authorization": "Bearer YOUR_MEWCP_KEY" } } } } ``` ### Cursor (mcp.json) ```json { "mcpServers": { "mewcp": { "url": "https://gateway.mewcp.com/personal/mcp", "headers": { "Authorization": "Bearer YOUR_MEWCP_KEY" } } } } ``` ### Claude Desktop (claude_desktop_config.json) ```json "mcpServers": { "mewcp": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "https://gateway.mewcp.com/personal/mcp", "--transport", "http-only", "--header", "Authorization: Bearer YOUR_MEWCP_KEY" ] } } ```