1. Introduction
Model Context Protocol (MCP) Servers can extend the functionality of LLMs. The CaaS Platform MCP server is such an MCP. It helps the LLM to use the CaaS GraphQL API to generate and execute queries.
The CaaS Platform MCP server is currently in an early stage of development - as is the underlying MCP concept as a whole. Planned enhancements and optimizations are being implemented on an ongoing basis. In the meantime, we welcome constructive feedback, suggestions, and ideas for new features.
2. Setup
To setup the CaaS Platform MCP server, follow these steps:
-
Open the MCP configuration of your AI tool.
-
Add the MCP server, similar to the following example:
{
"servers": {
"caas-platform-mcp": {
"url": "https://caas-mcp.e-spirit.cloud/sse"
}
}
}
3. Usage
The CaaS Platform MCP server provides prompts and tools to interact with the CaaS GraphQL API. For best results, use the provided prompt to get an optimised text for your LLM agent and then send it.
3.1. Develop a CaaS GraphQL Query
prompt
Choose this prompt, fill in the variables and run it. To use it, make sure you have the following information available:
-
The GraphQL endpoint URL:
<baseUrl>/graphql/<app>
-
An API key for the URL above:
<apikey>
. The URL and API key can be copied and pasted from the CaaS Connect module configuration dialog of the FirstSpirit project.`
-
The GraphQL schema file location. This is needed because the schema can get very large and burn through your LLM token limit if it were to be fetched on every prompt. Note that some LLM clients require the schema to be in the same repository as the current context.
-
The query description: A short description of what you want to query. For example: "Generate a query that returns the titles and IDs of all blog categories."
The CaaS Platform MCP server will return an optimised prompt which will allow the AI to generate the best possible response.
3.1.1. Prompt details
The following is provided because MCP support is still in its early stages and not all LLM clients support them yet. If your client does not, you can instead fill out the variables in the following manually and send it to your LLM directly:
Create a GraphQL query for the following description: <description> QUERY </description>.
Use Endpoint URL: <url> ENDPOINT URL </url>.
Use Bearer Token: <token> APIKEY </token>.
The GraphQL schema is located at <schemalocation> SCHEMA </schemalocation>.
Read the relevant parts of the schema to create an optimised query (with variables if needed) that only fetches the necessary fields.
Only include fields in the query that are defined in the schema.
Verify that the suggested query with the suggested variables works by using the tool "graphql-execution".
Print out the final query and variables in your answer.
The following shows an example of a query without filters:
<query>query { homepagePageRefs { _id } }</query>
The following shows an example how to use filter in queries:
<query>query($filter: BsonDocument) { homepagePageRefs(filter: $filter) { _id } }</query>
With the actual filter being defined in variables property.
Always define the filter in variables, never directly in the query.
The variables must be provided as a native object. Do not stringify or escape the variables.
Filter options are based on MongoDB operators according to the RESTHeart syntax: https://restheart.org/docs/mongodb-rest/read-docs#filtering-documents
Filter nested field equals value: <variables>{ "filter": { "locale.identifier": "EN" } }</variables>
Filter value greater than: <variables>{ "filter": { "changeInfo.revision": {"$gt":75} } }</variables>
Filter multiple conditions with AND: <variables>{ "$and":[{"qty":{"$gt":75}},{"status":"D"}] }</variables>
3.2. graphql-execution
tool
This tool allows the LLM to execute GraphQL queries against the CaaS API. It is used by the LLM to verify that the query it generated is valid and returns the expected results. You will need to give your LLM permissions to use this tool if it asks you. For ideal results, the tool should be triggered by the Develop a CaaS GraphQL Query
prompt.
4. Legal information
The Content as a Service is a product of Crownpeak Technology GmbH, Dortmund, Germany.
Only the licence granted by Crownpeak Technology GmbH is valid for the use of the product by the user.
5. Help
The Technical Support of the Crownpeak Technology GmbH provides expert technical support covering any topic related to the FirstSpirit™ product. You can get and find more help concerning relevant topics in our community.
6. Disclaimer
This document is provided for information purposes only. Crownpeak Technology GmbH may change the contents hereof without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. Crownpeak Technology GmbH specifically disclaims any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. The technologies, functionality, services, and processes described herein are subject to change without notice.