Chapter 2 : Data MCP Servers
Build Data MCP Servers
- Build MCP Servers with No-code and Customize & Extend to complete your use case.
- Use MCP Servers via AI Editors like Cursor or Cline
Getting Started
Please undertake below tutorial first , if you have not:
- Build Your First App
- With Focus on Backend Spring-Java
MCP Server - Spring Java
info
- MCP Server - Spring Java is built along with Backend spring-java.
- Project Location in downloaded dir is at e.g.
EmGenDir_JohnDoe_WS_51069\WS_51069\mcp\spring-java\emmcp
Run Builds and Explore
tip
MCP Layer Connects to API Layer, REST or GraphQL. So please configure and run destination API Layer first.
- APIs Run Builds and Explore
- Please execute & run backend/spring-java/emapi project:
- Compile, Deploy, Run.
- Refer to Tutorial Section 2-5-A : Backend Spring Java
MCP Server Project Build
- Open Maven Project in IDEA IntelliJ
- Maven Goal: package
- Note down jar location, e.g.:
C:\Users\JohnDoe\Downloads\EmGenDir_JohnDoe_WS_51123\WS_51123\mcp\spring-java\emmcp\app\mcprest\target\mcprest-1.0-SNAPSHOT.jar
Configure and Run
Configure MCP Server
- Please follow Readme in downloaded dir:
mcp\spring-java\README-MCP-Server.md
Available Tools in Data MCP Server
- To see Available Tools in Data MCP Server for REST and GraphQL,
- Please refer to: Data MCP Server Features
MCP Server For REST
Configure MCP Server For REST
- Please follow Readme in downloaded dir:
mcp\spring-java\README-mcprest.md
tip
- Refer to some general screenshots on MCP Server configuring in below also:
- Tutorial 7 : AI Based Development
- Chapter 2 : EasyManage Builder MCP Server
- Tutorial 7 : AI Based Development
- MCP Added
- MCP Tools
Use MCP Server For REST with Cursor Chat
- Ask Questions and get data insights
- MCP Server For REST Run by following below sections in Readme
README-mcprest.md
:- Available Tools
- Sample Chats
Example Chat Usage
Get Schema Details
easymanage get all api schema
get details for entity Product
get schema for ViewAll
General
easymanage get table data from Product table in table format
Get Paged Data With Queried & Sorted
- To get queried and sorted data as per parameters as pages
- With Flexible SQL-Like Querying
easymanage get table data as pages from Product table queried as "productId > 2" sorted by "productName desc" with 1 page size 3
- Please note parameters for above Tool call were constructed properly by AI:
- Try some chat queries
easymanage find the top 3 products with maximum inventory quantity
- Once get response then,
save above response to file top-3-products.txt
- file
top-3-products.txt
will be created.
info
How to Re-use or Share Input Queries & Prompts
You can re-use the input prompts for yourself or other users. Please open a project in Cursor which is mapped to shared drive which stores the shared input prompts files.
e.g.
- Create file
product01.md
in project root, with contents:
easymanage get table data as pages from Product table queried as "productId > 2" sorted by "productName desc" with 1 page size 3
Then In chat window click @ Add Context and search and select above file as context.
- Then in chat you can enter input:
use prompt from context file
LLM will reply like:
I'll execute the query from the context file to get table data from the Product table with the specified parameters.
and it will provide the response.
AI Transactions - Create, Update, Delete
Create
easymanage what tool is available to create customer record
want to see an example of how to use this tool
run the tool with values as below
{
"customerId": "4001",
"customerName": "Customer 4001",
"created": "2023-03-19 15:53",
"updated": "2023-03-19 15:53",
...
}
- Sample Screen
Update
easymanage what tool is available to update tenant record
want to see an example of how to use this tool
run the tool with values as below
{
"tenantId" : 2,
"TenantTblRec1":
{
"tenantId" : 2,
"tenantName" : "New Name Tenant 2",
...
}
}
- Sample Screen (customer)
Delete
easymanage what tool is available to delete tenant record
want to see an example of how to use this tool
- Sample Screen (customer)
run the tool with value "1010"
- Sample Screen (customer)
MCP Server For GraphQL
Configure MCP Server For GraphQL
Please follow Readme in downloaded dir:
mcp\spring-java\README-mcpgraphql.md
See sample screens For REST which, are similar
Use MCP Server For GraphQL with Cursor Chat
Ask Questions and get data insights
MCP Server For GraphQL Run by following below sections in Readme
README-mcpgraphql.md
:- Available Tools
- Sample Chats
See sample screens For REST which, are similar