Skip to content
AstroWay/api v2.325.0 · integrations
all systems operational

Dify

Last updated View as Markdown Agent setup

Dify gives agents and workflows two ways to AstroWay. MCP pulls in ready tools with descriptions and schemas, so the agent needs nothing explained. Swagger API builds a tool from a small OpenAPI schema, for when you need one or two specific calls and full control over what the model sees.

The whole-catalogue server, https://mcp.astroway.info/mcp, carries 843 tools, and their descriptions together take 3.4 MB: too much to hand a model on every step. Connect a domain server for the task. The full list with descriptions is at mcp.astroway.info/domains, for example:

TaskURL
Natal chart, horoscopes, Moon phasehttps://mcp.astroway.info/mcp/core
Vedic astrology and Vastuhttps://mcp.astroway.info/mcp/vedic
Tarothttps://mcp.astroway.info/mcp/tarot
Human Designhttps://mcp.astroway.info/mcp/human-design
Documentation search, no keyhttps://mcp.astroway.info/mcp/docs
  1. Integrations → Tools → MCP → Add MCP Server (HTTP).
  2. Server URL: an address from the table, Name: AstroWay core, Server Identifier: astroway-core. Apps refer to the server by that identifier, so do not change it later.
  3. Authentication, one of two options:
    • OAuth (the default). Leave Dynamic Client Registration on. Dify registers itself with our authorization server and opens an AstroWay sign-in window; calls are charged to the credits of the account that approved access.
    • A key. Turn Dynamic Client Registration off and under Advanced Options → Custom Headers add Authorization with the value Bearer aw_live_.... Use a Server only key: Dify calls from its own servers. The MCP server accepts a key only in Authorization: Bearer; an X-Api-Key header gets 401 here.
  4. Save. Dify imports the tools, and in an agent or an Agent node you can pick just the ones you need, for example astroway_western_chart and astroway_calendar_moon_phase.

Every tool carries a [Cost: ...] line with its price in credits in its description, and the model sees it before the call. Tools marked Heavy or Premium are worth allowing only with the user’s confirmation.

Way 2. An HTTP tool from an OpenAPI schema

Section titled “Way 2. An HTTP tool from an OpenAPI schema”

The full API specification is too big for a tool, so we made a minimal schema for two endpoints that spend no credits: today’s horoscope for a sign and the Moon phase.

  1. Integrations → Tools → Swagger API → Create.
  2. Import the schema from https://api.astroway.info/integrations/dify-astroway-openapi.json or paste its content. Dify shows two actions: dailyHoroscope and moonPhase.
  3. In the tool’s authorization pick an API Key in a header, header name X-Api-Key, the value your Server only key scoped to public/horoscope/* and public/moon-phase.
  4. Test the dailyHoroscope action with sign=leo.

To add another endpoint, write it into the schema: its path and parameters are on the endpoint’s page in the API reference. For a natal chart pass ?fields= with the fields you need, or the model gets tens of kilobytes: /v1/chart?fields=planets.name,planets.longitude,houses.ascendant returns about half a kilobyte.