SuperAPIAI Directory

pbs-mcp-server

github.com · AI developer platforms

pbs-mcp-server is a standalone Model Context Protocol (MCP) server for accessing the Australian Pharmaceutical Benefits Scheme (PBS) API. It allows AI models to query data such as medicine information, pricing, and availability through natural language prompts, supports stdio and HTTP/SSE transport layers, and provides a command-line tool. The project is built on the public API and can also be adapted to private APIs.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

pbs-mcp-server is a standalone server based on the Model Context Protocol (MCP), designed to enable AI models to access the public API of the Australian Pharmaceutical Benefits Scheme (PBS). This API provides information such as medicine listings, pricing, and availability. Through this server, AI assistants can obtain PBS data in real time without having this information built into their training data.

Main capabilities:

  • Provides tools for querying PBS API endpoints, enabling AI models to access medicine data.
  • Supports two transport layers: stdio and HTTP/SSE.
  • Includes comprehensive error handling for API rate limits and authentication issues.
  • Receives tool calls and prompts from LLM components, enabling seamless AI interaction.
  • Can translate natural language prompts (such as medicine-related questions) into appropriate PBS API calls and return structured data.

Usage:

  1. Clone the repository and install dependencies: git clone <repository-url>, then npm install.
  2. Build the project: npm run build.
  3. Start the server:
    • stdio mode: compatible with the MCP protocol, communicating via standard input/output streams.
    • HTTP mode: starts an HTTP server with Server-Sent Events (SSE) support, with an optional port (default 3000).
    • Command-line tool: run using npm run cli -- <command> or ./start.sh cli <command>.
  4. Integrate with MCP clients: Claude Desktop or other AI assistants that support MCP can be configured as tool providers, and the assistant will automatically discover and use the tools provided by the server. Custom applications can communicate via HTTP API endpoints, SSE endpoints, or stdio.

API tool parameters:

  • endpoint (string, required): the PBS API endpoint to access (e.g., "prescribers", "item-overview").
  • method (string, optional): HTTP method, default "GET".
  • params (object, optional): query parameters.
  • subscriptionKey (string, optional): custom subscription key; the default public key is used when not provided.
  • timeout (number, optional): request timeout (milliseconds), default 30000.

HTTP mode endpoints:

  • /status: returns server status.
  • /tools: returns the list of available tools.
  • /sse: establishes an SSE connection and sends tool events.
  • /invoke (SSE): invokes a tool and sends the result via SSE.
  • /invoke (REST): invokes a tool and returns a JSON result.

Command-line interface commands:

  • list-endpoints: lists all available PBS API endpoints.
  • get-api-info: returns PBS API information.
  • query-prescribers: queries prescriber information, supporting options such as --limit, --page, --pbs-code, --schedule-code, --prescriber-type, --fields, and --latest.
  • query-item-overview: queries the item overview.
  • query-any-endpoint: queries any endpoint, supporting the --method, --params, --subscription-key, and --timeout options.
  • start-http-server: starts the HTTP server, supporting the --port option.

Available PBS API endpoints include: /, /prescribers, /item-overview, /items, /schedules, /atc-codes, /organisations, /restrictions, /parameters, /criteria, /copayments, /fees, /markup-bands, /programs, /summary-of-changes, etc.

Subscription key: Using the PBS API requires a subscription key. You can visit https://data-api-portal.health.gov.au/ Register an account, subscribe to the "PBS Public API v3" product, obtain a key, and configure it in the .env file (see .env.example).

Limitations:

  • The PBS public API is rate-limited to one request every 20 seconds (shared across all users).
  • Only the current schedule and schedules published within the past 12 months are available through the public API.
  • Some endpoints require specific parameters.
  • The API structure and endpoints may change over time.
  • It is recommended to call regularly and update the required data weekly.

Use cases: Suitable for developers who need to integrate Australian Pharmaceutical Benefits Scheme data into AI workflows, users of AI assistants, and those building healthcare-related AI applications.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools