Ghost MCP Server

by MFYDev
Verified

make_ghost_request

Make an authenticated request to the Ghost API.

Args: endpoint: API endpoint to call (e.g. "posts" or "users") headers: Request headers from get_auth_headers() ctx: Optional context for logging (not used for resources) is_resource: Whether this request is for a resource http_method: HTTP method to use (GET, POST, PUT, or DELETE) json_data: Optional JSON data for POST/PUT requests Returns: Parsed JSON response from the Ghost API Raises: GhostError: For any Ghost API errors including: - Network connectivity issues - Invalid authentication - Rate limiting - Server errors ValueError: For invalid HTTP methods Example: >>> headers = await get_auth_headers("1234:abcd5678") >>> response = await make_ghost_request( ... "posts", ... headers, ... http_method=GET ... )

Input Schema

NameRequiredDescriptionDefault
ctxNo
endpointYes
headersYes
http_methodNoGET
is_resourceNo
json_dataNo

Input Schema (JSON Schema)

{ "$defs": { "Context": { "description": "Context object providing access to MCP capabilities.\n\nThis provides a cleaner interface to MCP's RequestContext functionality.\nIt gets injected into tool and resource functions that request it via type hints.\n\nTo use context in a tool function, add a parameter with the Context type annotation:\n\n```python\n@server.tool()\ndef my_tool(x: int, ctx: Context) -> str:\n # Log messages to the client\n ctx.info(f\"Processing {x}\")\n ctx.debug(\"Debug info\")\n ctx.warning(\"Warning message\")\n ctx.error(\"Error message\")\n\n # Report progress\n ctx.report_progress(50, 100)\n\n # Access resources\n data = ctx.read_resource(\"resource://data\")\n\n # Get request info\n request_id = ctx.request_id\n client_id = ctx.client_id\n\n return str(x)\n```\n\nThe context parameter name can be anything as long as it's annotated with Context.\nThe context is optional - tools that don't need it can omit the parameter.", "properties": {}, "title": "Context", "type": "object" } }, "properties": { "ctx": { "anyOf": [ { "$ref": "#/$defs/Context" }, { "type": "null" } ], "default": null }, "endpoint": { "title": "Endpoint", "type": "string" }, "headers": { "additionalProperties": { "type": "string" }, "title": "Headers", "type": "object" }, "http_method": { "default": "GET", "title": "Http Method", "type": "string" }, "is_resource": { "default": false, "title": "Is Resource", "type": "boolean" }, "json_data": { "anyOf": [ { "type": "object" }, { "type": "null" } ], "default": null, "title": "Json Data" } }, "required": [ "endpoint", "headers" ], "title": "make_ghost_requestArguments", "type": "object" }