Getting started with the CAST Imaging Express MCP Server
Overview
These instructions explain how to configure GitHub Copilot to interact with CAST Imaging Express’s dedicated MCP server, enabling you to quickly obtain AI-generated insights about your applications.
Prerequisites
- An active CAST Imaging Express subscription
- Your personal API key: see Generate and use an API key
Recommended LLMs
Multiple LLM providers are supported; however, not all models perform equally when it comes to tool invocation, reasoning, and response reliability. During internal testing, the Claude Sonnet 5.5 and Claude Haiku 5.5 models consistently delivered the best results, especially for a wide range of user queries, from simple to highly complex, with strong consistency and minimal hallucinations. Findings are listed below:
| Provider | Recommended model | Notes |
|---|---|---|
| Claude (Anthropic) | Claude Sonnet 5.5/ Sonnet 4.6 | Most reliable for complex queries requiring multiple tool calls and high-accuracy reasoning. Strong natural-language understanding and minimal hallucinations. |
| Claude (Anthropic) | Claude Haiku 5.5/ Haiku 4.5 | Fast, efficient, and cost-effective. Well-suited for simpler queries while still maintaining good accuracy. |
| ChatGPT (OpenAI) | GPT-6 Sol/ GPT-6.1 Terra | Solid overall models for simple to moderately complex user queries. |
| ChatGPT (OpenAI) | GPT-6 Luna | Lower token consumption and suitable primarily for very basic queries. |
Setup instructions for GitHub Copilot for Visual Studio Code
Refer to MCP servers in VS Code for more information.
Step 1 - Initial configuration
- Install the GitHub Copilot extension (see GitHub Copilot on the Visual Studio Marketplace ) in Visual Studio Code.
- Ensure you are signed in to GitHub and clone the repository you need to work with.
- Create an
mcp.jsonconfiguration file and place it in the.vscode/folder for your Visual Studio Code workspace. Themcp.jsonmust use the following template:
{
"inputs": [
{
"id": "imaging-key",
"type": "promptString",
"description": "CAST Imaging Express API Key"
}
],
"servers": {
"CASTImaging": {
"type": "http",
"url": "https://castimaging.io/imaging/mcp/",
"headers": {
"x-api-key": "${input:imaging-key}"
}
}
}
}
Multi organizations (tenant) access
If your user account has access to multiple organizations, the required “tenant ID” must be provided using the X-TENANT-ID header (the API will default to the first tenant the user is associated with if it is not provided). This can be done by adding "x-tenant-id": "<tenant_id>" (and applying the required tenant ID) as follows:
{
...
"servers": {
"CASTImaging": {
"type": "http",
"url": "https://castimaging.io/imaging/mcp/",
"headers": {
"x-api-key": "${input:imaging-key}",
"x-tenant-id": "<tenant_id>"
}
}
}
}
To retrieve the list of tenants your user is associated with, use the following API:
$ curl -H "X-API-KEY: my-secret-key" https://castimaging.io/api/auth/user/tenancy
Step 2 - Verify the connection
When the mcp.json file is configured, you can verify the connection:
- Launch Github Copilot
- Enter your CAST Imaging API key when prompted
- Run a test query, for example:
"List all of the apps available"
If configured correctly, your assistant should be able to access your CAST Imaging Express account and respond with your project information, listing all the applications that are available to you.
How the MCP server exposes its tools
CAST Imaging Express runs three MCP servers behind a single URL (https://castimaging.io/imaging/mcp/):
| Server | Use it for | Tools your AI client sees |
|---|---|---|
| Structural | Exact lookups: applications, architecture, transactions, data graphs, objects, source files, dependencies, quality insights, tags, post-its and saved views | get_structural_search_function_syntax, run_structural_search_function |
| Semantic search | Questions about meaning, answered from the application’s Business graph: business rules, business entities and topics, or where a feature is implemented | get_semantic_search_function_syntax, run_semantic_search_function |
| Text-to-Graph | Plain-language questions answered with graph queries: callers and callees, flows between projects, services and modules, conditional flows and advisors | get_text2graph_function_syntax, run_text2graph_function |
Your AI client therefore lists six tools, not one tool per feature. Each server offers many functions, which the AI client uses in two steps:
- It calls the
get_..._syntaxtool to find out which functions exist and how to call them. - It calls the matching
run_...tool with the function name and its arguments.
You do not need to do anything: the model selects the server and the function from your question. The sections below list the functions that each server offers.
Example queries
Use the following example queries for the fictional application “Shopizer” as inspiration for your own queries:
Basic application information
Show me all applications available in my Imaging environment.
Which application has the largest number of transactions?
Transaction analysis
Explain about the entire graph of #customer-create-link transaction present in the Shopizer App.
List all the transactions in Shopizer app with the name containing “customer”.
Add a post-it on the transaction named #customer-create-link in Shopizer with title as "MCP post-it" and description as "This is a post-it created by MCP server".
Data flow analysis
Explain about the entire graph of CATEGORIES_DESCRIPTION datagraph present in the Shopizer App.
List all the data call graphs in Shopizer app with the name containing "CATEGORIES".
Add a post-it on the data graph named CENTRAL_CREDIT_CARDS in Shopizer with title as "MCP post-it" and description as "This is a post-it created by MCP server".
Quality insights
List all the ISO-5055 quality insights in the object pageProductReviews in Shopizer app?
List the top 5 structural flaws by occurrence count in app Shopizer.
List some of the green deficiencies present in the app Shopizer app.
Architectural analysis
Provide the high-level architecture view of Shopizer app.
Explain the architecture Shopizer app at User Interaction Level.
Structural functions
The structural server offers the following functions. Your AI client calls them through run_structural_search_function.
- Portfolio functions - overall portfolio exploration for cross-application analysis, when you want to explore multiple applications, compare metrics across the entire portfolio, or discover available applications before diving into specific ones.
- Application functions - application-level exploration for analyzing a single application in depth, covering architecture, quality insights, transactions, data graphs, saved views, packages, dependencies, and overall application statistics and structure.
- Object functions - object-level exploration for drilling down into specific code artifacts (classes, methods, tables, functions) within an application - examining their properties, relationships, callers/callees, tags, usage in transactions, and associated quality insights.
Portfolio functions
all_applications- fetch all available applications.my_applications- fetch applications belonging to the user only.applications_transactions- retrieve transactions across all applications available in CAST Imaging Express with filtering.applications_data_graphs- retrieve Data Call Graph views across all applications available in CAST Imaging Express with filtering.applications_dependencies- analyze inter-application dependencies across the available applications showing incoming and outgoing relationships for each app.applications_quality_insights- get quality insights across all applications in CAST Imaging Express with selective insight types:cve- security vulnerabilitiescloud- cloud maturity patternsgreen- sustainability patternsstructural-flaws- architectural issuesiso-5055- ISO quality violations
Application functions
stats- get basic statistics for an application including size, complexity, and technology metrics.architectural_graph- visualize application architecture (nodes/links) for an application at a specific abstraction levels (layer, component, sub-component, technology-category, element-type).architectural_graph_focus- get architecture focused on specific components for an application, useful for exploring architecture around key areas.quality_insights- retrieve quality issues and vulnerabilities including CVE, cloud patterns, green patterns, structural flaws, and ISO-5055 violations for an application.quality_insight_violations- get detailed information about the occurrences (specific locations) for a particular quality related insight type and ID in an application. Returns quality patterns and violating objects and their details.packages- list external packages, libraries or dependencies used by the application.package_interactions- analyze interactions between different packages for an application to understand dependency relationships with it.transactions- fetch transactions for an application with optional filtering capabilities by name or type of the transaction.transaction_profiles- list the transaction profiles of an application.transaction_details- get comprehensive details about specific transactions with multiple focus options:complexity- list of complex objects in the flow graph of transaction.insights- list objects in the transaction flow with Quality insightsnodes- list of all objects in the transaction graphlinks- list of all links/connections between objects in the transaction graphgraph- full call graph of the transactiontype_graph- graph results aggregated by object typescomplexity_graph- reduced version of a transaction graph to represent only most complex objects.documents- list documents like post-its attached to a transactionsummary- fetch the AI-generated summary attached to the transaction (if available)callers- incoming flows towards the starting objects of the transactioncallees- outgoing flows from the ending objects of the transaction
manage_view_document- add or delete a document (post-it) on a transaction or data call graph.data_graphs- fetch data call graph views for an application with optional filtering capabilities.data_graph_profiles- list the data call graph profiles of an application.data_graph_details- get detailed information about specific data call graph flow with multiple focus options:complexity- list of complex objects in the flow graph of a data call graph.insights- list objects in the data call graph flow with Quality insightsnodes- list of all objects in the data call graph.links- list of all links/connections between objects in the data call graphgraph- full call graph for a data graph view.type_graph- graph results aggregated by object types.complexity_graph- reduced version of a data graph to represent only most complex objects.documents- list documents like post-its attached to a data call graph view.summary- fetch the AI-generated summary attached to the data call graph (if available)
application_database_explorer- explore database tables and columns in an application with three modes:- List all tables
- Filter tables by name
- Get columns for specific table(s)
application_iso_5055_explorer- explore ISO 5055 software quality characteristics (Security, Reliability, Performance, Maintainability) and their associated weaknesses.views- list the saved views of an application.view_details- get the content of a saved view: its objects, links and layout.manage_view- create, update or delete a saved view.
Object functions
objects- search and filter objects (classes, methods, tables, etc.) in an application. Supports:- filtering by
name,fullname,type,mangling,filepathorannotationwith thecontains(default),equals,startswithorendswithoperator. All filters in one query must use the same operator, e.g.name:contains:Order,type:contains:Method. - restricting results to internal or external objects with
searchtype:eq:internalorsearchtype:eq:external. - filtering by tags.
- filtering and sorting by an integer metric, such as
Cyclomatic Complexity,Number of code lines,Number of Commented Code LinesorEfferent Coupling (CE). Results can be sorted highest or lowest first, or limited with a threshold (greaterThan,lessThan,greaterThanEqualTo,lessThanEqualToorequals), and each object is returned with its metric value. A metric can be combined withtype,searchtypeand tags, and withnameorfullnameusingcontainsonly (case-sensitive). It cannot be combined withmangling,filepathorannotation.
- filtering by
object_profiles- get metric profiles per object type for an application, such as the average, minimum and maximum number of code lines or cyclomatic complexity. Returns one aggregate per object type, not values for individual objects - useobjectswith a metric for those.object_details- get comprehensive details about specific objects with multiple focus options:intra- basic properties and child objectsinward- incoming dependencies (callers)outward- outgoing dependencies (callees)testing- fetch related transactions and data graphs.insights- quality issues/insights for objectdocuments- fetch attached documents i.e. post-its to an object (if available)endpoints- start points and end points connected to the object
manage_object_document- add or delete a document (post-it) on an object.manage_object_tags- add or remove tags on a list of named objects.bulk_manage_object_tags- add or remove tags on every object matching a rule (type, name, path, annotation, tag, transaction or data graph), with a preview before the change is applied.objects_relationships- show how a set of objects are connected to each other.pathfinder_hierarchy_details- find the call path between two objects, or show the parent-child structure around an object.source_files- find source files that define code objects, matching a specified file path pattern (contains filter).source_file_details- get detailed dependency analysis for source files with multiple nature options:inventory- all defined code elementsintra- internal dependencies within fileinward- incoming dependencies to fileoutward- outgoing dependencies from filetesting- elements requiring tests if file changes
transactions_using_object- identify all transactions that use a specific object based on a criteria.data_graphs_involving_object- find all data call graphs involving specific objects based on criteria. Essential for understanding data dependencies.
Semantic search functions
The semantic search server answers questions from the application’s Business graph, the GraphRAG knowledge graph built from AI summaries of the application. It returns results only for applications where a Business graph has been generated. Your AI client calls its functions through run_semantic_search_function.
For example:
Using semantic search, list the business rules for Shopizer.
Where is order cancellation implemented in Shopizer?
Which business topics are related to payment in Shopizer?
Which business concepts are used in the #customer-create-link transaction in Shopizer?
Text-to-Graph functions
The Text-to-Graph server answers plain-language questions by running graph queries on your application. It covers objects and their callers and callees, transactions and data graphs, projects, services and modules and the flows between them, conditional flows, advisors and quality rules, and saved views. Your AI client calls its functions through run_text2graph_function.
For example:
Who are the direct callers of this method?
Which programming languages are used in my portfolio?
Which quality rules are violated most often in Shopizer?
Show the flows between the services of Shopizer.
Security best practices
- Never share your API key with others or commit it to version control
- Rotate your API keys regularly in Profile settings > API key management
- Revoke unused keys to minimize security risks
- Use separate keys for different applications or team members
Troubleshooting
Connection failure
- Verify your API key is correct and active
- Ensure your network allows connections to CAST Imaging Express
- Review your client’s logs for specific error messages
Slow response times
- Check your internet connection
- Verify the CAST Imaging Express service status
- Consider the size of datasets you’re querying