6. Follow-along: Enable introspection
2m

Follow-along: Expand the graph

We have more than just listing details available in our . It also has bookings, reviews, users, and payments.

  1. Open up the supergraph.yaml file.

  2. Uncomment the information for the accounts, bookings, reviews, and payments .

    supergraph.yaml
    subgraphs:
    listings:
    routing_url: https://rt-airlock-subgraphs-listings.herokuapp.com/
    schema:
    subgraph_url: https://rt-airlock-subgraphs-listings.herokuapp.com/
    accounts:
    routing_url: https://rt-airlock-subgraphs-accounts.herokuapp.com/
    schema:
    subgraph_url: https://rt-airlock-subgraphs-accounts.herokuapp.com/
    bookings:
    routing_url: https://rt-airlock-subgraphs-bookings.herokuapp.com/
    schema:
    subgraph_url: https://rt-airlock-subgraphs-bookings.herokuapp.com/
    reviews:
    routing_url: https://rt-airlock-subgraphs-reviews.herokuapp.com/
    schema:
    subgraph_url: https://rt-airlock-subgraphs-reviews.herokuapp.com/
    payments:
    routing_url: https://rt-airlock-subgraphs-payments.herokuapp.com/
    schema:
    subgraph_url: https://rt-airlock-subgraphs-payments.herokuapp.com/
  3. Save your changes and rover dev will restart, composing the new with all the available .

To help us explore this larger , we'll enable capabilities in our MCP server configuration.

GraphQL introspection & MCP

lets you information about the schema and discover the types, , and available in the graph.

enables AI agents to craft their own queries, which can address user needs or questions more precisely than predefined queries.

But comes with a downside: by providing all the details about a schema, we might introduce security concerns. Bad actors can end up seeing more than they should, which can result in unauthorized queries being executed against the .

In this workshop, we'll use for an internal use case, as a developer using an agent to explore the so we can build new tools.

Note: You can add security layers to make more secure, such as OAuth and to control which and types an agent can access.

You can configure the following MCP server tools to enable capabilities:

  • introspect: Get the full
  • search: Search for types, , or other schema elements
  • validate: Validate queries without executing them
  • execute: Execute dynamically

Your MCP client will generally first try to introspect or search to retrieve information about the schema. Then, it will craft the it needs, use validate to check if the is valid, and finally execute the .

Follow-along: Enable introspection

  1. Add the following configuration to your mcp.yaml file:

    mcp.yaml
    introspection:
    execute:
    enabled: true
    introspect:
    enabled: true
    minify: true
    search:
    enabled: true
    minify: true
    index_memory_bytes: 50000000
    leaf_depth: 1
    validate:
    enabled: true

    With this configuration, we've enabled all the capabilities. We've also turned on minification to reduce the size of responses.

  2. After saving your changes, restart the MCP server.

    rover dev --supergraph-config supergraph.yaml --mcp mcp.yaml --router-config router.yaml

Follow-along: Test with MCP Inspector

  1. Run the MCP Inspector again with npx @modelcontextprotocol/inspector. You should now see 4 additional tools: execute, introspect, search, and validate.

  2. Try using the introspect tool in the MCP Inspector to see what it returns. You should get the complete definition for your API.

  3. Try using the search tool to search for the Booking type.

  4. Try validating the GetFeaturedListings .

  5. Try executing the GetFeaturedListings .

GetFeaturedListings operation
query GetFeaturedListings {
featuredListings {
id
title
coordinates {
latitude
longitude
}
}
}

Follow-along: Test with Claude

Now let's restart Claude and test the new capabilities:

  1. Restart Claude Desktop to pick up the new tools
  2. Check that Claude now has access to the tools for your airlock-mcp server
  3. Ask Claude: "What can you tell me about Airlock's schema?"
  4. Claude will ask to use the introspect tool. Click Allow once.
  5. Claude will return a detailed response outlining the schema structure, available types, , and .

Practice

Which of the following introspection tools are available to use? Select all that apply.
True or false: You need to enable all the introspection tools.
What is the primary benefit of enabling introspection for Claude?
Previous