How the Spring Tools MCP Server and GitHub Copilot together make Spring Development more efficient.
Introduction
If you write Spring Boot applications in Eclipse, you already know that Spring Tools for Eclipse brings best-in-class tooling right into your IDE, including quick navigation and visualization of core Spring elements in your projects, live information from running Spring Boot applications, Spring specific auto completion, validations and quick fixes, request mapping overviews, and much more. In addition to that, if you have the GitHub Copilot plugin for Eclipse installed, you have a powerful AI coding assistant at your fingertips.
But here is the question that most developers haven’t asked yet: what does Copilot actually know about your Spring project, and how efficiently can it get that context? Copilot can search across the repository and infer a lot from source files, but that is still a general discovery process. It does not automatically have direct, structured access to things like your beans graph, the resolved classpath, the exact Spring Boot version, or the diagnostics your IDE is already computing. Spring Tools MCP Server helps close that gap by giving Copilot a fast, direct way to retrieve Spring-specific project information through a small number of targeted tool calls, which can improve response quality and may also reduce unnecessary exploration and token usage.
This post explains why this matters and walks you through two hands-on demos so you can see it in action.
Why Connect Copilot to the Spring Tools MCP Server?
Before diving into the setup, it’s worth understanding the core problem this solves and what you gain.
The Spring Tools MCP server exposes the Spring specific facts that it knows about your projects as callable tools. When Copilot’s agent mode needs to answer a Spring question, it can call one of those tools to fetch the real answer from your running IDE instead of guessing or searching for the answer by reading all sources from your project, using grep in the command line, or similar techniques. This is the difference between a colleague who has never seen your project and one who has had it open for hours.
Benefits at a Glance
| Benefit | What it means for you |
| Token savings | Copilot fetches only the structured facts it needs on demand, rather than reading through large amounts of source files. This means lower latency and cost per interaction. |
| Grounded accuracy | Responses are based on static analysis inside the IDE , not training-time guesses. Hallucinated bean names, missing imports, and wrong API calls drop dramatically. |
| Version-aware suggestions | The Spring Tools MCP server reports your exact Spring Boot version, so Copilot will not suggest APIs introduced in Boot 3.x when you are on 2.7, or vice versa. |
| Version validation | The Spring Tools MCP server compares the Spring Boot version used in the projects to those that are available to make Copilot aware of available updates and latest versions in general, so that Copilot always stays on top of the latest Spring versions available. It can even use project-defined repositories to look up available versions, so that it can make Copilot aware of the latest versions available to you specifically (e.g. via a commercial support or a company-internal repository). |
| Correct bean wiring | Copilot knows the real bean graph: which beans exist, what their types are, and how they depend on each other. |
| Stereotype awareness | The model sees which classes carry @Service, @Repository, @Controller, and other stereotypes (incuding user-defined ones and those that you assign to a class via supertypes instead of annotations), enabling more accurate architectural suggestions. |
| Live diagnostics | Copilot can read the exact errors and warnings your IDE has already detected before generating a fix, so it addresses real problems rather than imagined ones. |
| Feedback loops | The loop that is only possible with real IDE feedback: agents can fetch diagnostics, apply a fix, and re-fetch diagnostics to verify it worked. No need for the agent to execute long builds and evaluate the build output. |
| No stale knowledge | The MCP always reflects the current state of your workspace. Adding a dependency or renaming a bean is immediately visible to the agent. |
Getting Started
Prerequisites
- Spring Tools for Eclipse2.0 or later installed
- GitHub Copilot plugin for Eclipse installed and signed in
- A Spring Boot project open in your workspace
Step 1: Enable the Embedded MCP Server
The MCP server is experimental (at the moment) and must be switched on explicitly.
- In Eclipse, go to Window → Preferences → Spring → AI
- Check Enable embedded MCP server
- Click Apply and Close, then restart Eclipse
Tip
You may need to approve the auto detected MCP server after restarting you IDE.Step 2: Verify the MCP Is Registered with Copilot
Spring Tools automatically writes the MCP server entry into Copilot’s configuration for Eclipse. To confirm:
- Click the GitHub Copilot icon in the Eclipse toolbar.
- Go to Edit Preferences → MCP Servers.
- You should see an entry similar to:
{
"servers": {
"spring-tools-local-dev-server": {
"url": "http://localhost:50627/mcp",
"type": "http"
}
}
}
Tip
The port number might differ, but Spring Tools keeps the configuration up to date automatically, you do not need to update it manually.Step 3: Switch Copilot Chat to Agent Mode
MCP tools are only invoked in Agent mode, not in the standard chat mode.
- Open the GitHub Copilot Chat panel in Eclipse.
- In the model/mode selector at the top of the chat panel, switch from Chat to Agent.
- You are now ready to run the demos below.
Demos
The following two prompts demonstrate the collaboration between Copilot and the Spring Tools MCP server in action. In each case, Copilot will invoke one or more Spring Tools MCP tools automatically to ground its response in your live project data.
Demo 1: Exploring Your Application Context
One of the first things a new developer (or an AI agent) needs to understand about a Spring project is its bean graph: what’s registered, what type it is, and how components are wired together. Without the Spring Tools MCP server, Copilot can only guess that from what’s visible in the current file and by searching and reading through source files of your project. With the MCP server, it queries the Spring Tools for the authoritative answer.
Try this prompt in Copilot Agent mode:
What beans are registered in my application context?
What happens behind the scenes
When you send this prompt, Copilot’s agent recognizes it needs project-specific data. It calls the MCP tool to retrieve the full bean list from the Spring Tools, which has already indexed your project. The response is then structured and returned to you directly in chat.
You will receive a breakdown of all beans registered in your context, including:
- Bean name and fully qualified class name
- Stereotype (@Service, @Repository, @Controller, @Component, etc.)
- Dependencies and injection points
- Which module or configuration class registers each bean
Example response (truncated)
Your application context has 24 registered beans:
UserService @Service com.example.service.UserService
UserRepository @Repository com.example.repository.UserRepository
ProductController @RestController com.example.web.ProductController
SecurityConfig @Configuration com.example.config.SecurityConfig
DataSource @Bean com.example.config.DataSourceConfig
...
UserService depends on: UserRepository, PasswordEncoder
ProductController depends on: ProductService, UserService
This is data that the Spring Tools has already computed. The MCP server simply makes it available to the agent on demand — no file pasting, no hallucination, no token waste.
Demo 2: Fetching Live Project Diagnostics
The second demo shows something even more powerful: giving Copilot awareness of your project’s current errors and warnings before it tries to fix them. Without this, an AI agent might generate a fix that addresses a symptom while ignoring the root cause — or worse, introduces a new problem it can’t see.
Try this prompt in Copilot Agent mode:
Show me the Spring specific diagnostics of the project.
What happens behind the scenes
By explicitly naming the tool in your prompt, you instruct the agent to call getProjectDiagnostics on the Spring Boot Language Server. This is the same set of errors, warnings, and info markers you see in Eclipse’s Problems view — but now surfaced directly in chat, where Copilot can reason about them and propose targeted fixes.
The diagnostics response includes:
- File path and line number of each issue
- Severity level (Error / Warning / Info)
- A human-readable message (identical to what the IDE shows)
- The specific Spring rule or validation that triggered it
Example response (truncated)
Project diagnostics via getProjectDiagnostics (Spring Boot Language Server):
ERROR UserController.java:42
No bean of type 'EmailService' found in application context.
Consider adding @Service or @Component to EmailService.
WARNING SecurityConfig.java:17
@Configuration class missing @EnableWebSecurity.
Spring Security auto-configuration may not apply correctly.
INFO application.properties:5
Property 'spring.datasource.url' is deprecated since Boot 3.2.
Suggested replacement: spring.datasource.jdbc-url
3 issues found (1 error, 1 warning, 1 info).
Once Copilot has this information, you can follow up naturally: “Fix the missing EmailService bean error.” The agent already knows the exact location and the root cause, so it can generate a precise, correct fix, not a guess.
Tip
You can also let Copilot decide when to call getProjectDiagnostics on its own. In a multi-step agentic task (e.g. ‘Refactor UserService and make sure there are no new errors’), the agent will often call this tool automatically at the end to verify its changes did not introduce new problems.Discovering All Available MCP Tools
The Spring Tools MCP server exposes more tools than just the two shown above. You can discover everything it offers through the chat panel:
Chat Panel → Configure Tools → Model Context Protocol (MCP)
Conclusion
The Spring Tools MCP server bridges the gap between what GitHub Copilot knows in general and what it needs to know about your project specifically. By connecting Copilot’s agent mode to the live data your IDE already computes, you get responses that are grounded in reality, lighter on tokens, and accurate enough to trust.
Feedback
GitHub Copilot for Eclipse is open source, your voice shapes its future. Visit the repository at github.com/microsoft/copilot-for-eclipse to report issues, suggest features, or submit a pull request. Every contribution, big or small, helps make the Eclipse developer experience better for everyone.
The Spring Tools MCP server is at an early experimental stage, so we would love to hear your feedback and suggestions. You can find the Spring Tools (including the embedded MCP server) project at https://github.com/spring-projects/spring-tools/. Please visit the repository to report issues, suggest new features, or submit a pull request.



0 comments
Be the first to start the discussion.