Follow-along: Expand the graph
We have more than just listing details available in our graph. It also has bookings, reviews, users, and payments.
Open up the
supergraph.yamlfile.Uncomment the information for the
accounts,bookings,reviews, andpaymentssubgraphs.supergraph.yamlsubgraphs: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/Save your changes and
rover devwill restart, composing the new supergraph schema with all the available subgraphs.
To help us explore this larger graph, we'll enable introspection capabilities in our MCP server configuration.
GraphQL introspection & MCP
GraphQL introspection lets you query information about the schema and discover the types, fields, and operations available in the graph.
Introspection enables AI agents to craft their own queries, which can address user needs or questions more precisely than predefined queries.
But introspection 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 graph.
In this workshop, we'll use introspection for an internal use case, as a developer using an agent to explore the graph so we can build new tools.
Note: You can add security layers to make introspection more secure, such as OAuth and contracts to control which fields and types an agent can access.
You can configure the following MCP server tools to enable introspection capabilities:
- introspect: Get the full GraphQL schema
- search: Search for types, fields, or other schema elements
- validate: Validate GraphQL queries without executing them
- execute: Execute GraphQL operations dynamically
Your MCP client will generally first try to introspect or search to retrieve information about the schema. Then, it will craft the operation it needs, use validate to check if the operation is valid, and finally execute the operation.
Follow-along: Enable introspection
Add the following introspection configuration to your
mcp.yamlfile:mcp.yamlintrospection:execute:enabled: trueintrospect:enabled: trueminify: truesearch:enabled: trueminify: trueindex_memory_bytes: 50000000leaf_depth: 1validate:enabled: trueWith this configuration, we've enabled all the introspection capabilities. We've also turned on minification to reduce the size of responses.
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
Run the MCP Inspector again with
npx @modelcontextprotocol/inspector. You should now see 4 additional tools:execute,introspect,search, andvalidate.Try using the
introspecttool in the MCP Inspector to see what it returns. You should get the complete GraphQL schema definition for your API.Try using the
searchtool to search for theBookingtype.Try validating the
GetFeaturedListingsoperation.Try executing the
GetFeaturedListingsoperation.
query GetFeaturedListings {featuredListings {idtitlecoordinates {latitudelongitude}}}
Follow-along: Test with Claude
Now let's restart Claude and test the new introspection capabilities:
- Restart Claude Desktop to pick up the new tools
- Check that Claude now has access to the introspection tools for your
airlock-mcpserver - Ask Claude: "What can you tell me about Airlock's schema?"
- Claude will ask to use the introspect tool. Click Allow once.
- Claude will return a detailed response outlining the schema structure, available types, fields, and operations.