screenctx
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@screenctxcollect context for route /customer/detail"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
screenctx
screenctx collects the local files that explain one Spring Boot + MyBatis screen so you can hand a compact, structured context bundle to an AI tool (ChatGPT, Claude, Copilot, …) or read it yourself before making a change.
Given a single entry point — a route, a controller/Action class, a method, or a file — it walks the dependency graph (controller → business logic → DAO/Mapper → MyBatis XML, plus views, static assets, message properties, and config) and produces one Markdown file plus a copyable bundle.
It does static analysis only. No Maven/Gradle build, no Spring startup, no network. It favors recall over perfect precision, so related framework/base files may be included when they clarify the screen flow. References it cannot resolve statically (reflection, string-built bean names, runtime-only SQL ids) are reported under unresolved.
It collects, with reasons, things like:
Spring Boot controllers or legacy-style
ActionclassesJSP / Thymeleaf / template views and static assets
FormBean, input/output beans, DTOs, constants, validators, helpersBLogic/BaseLogic/ServiceclassesMapper/DAO interfaces and MyBatis/iBATIS SQLMap XML
message/error
.propertiesapplication.yml,application.properties,mybatis-config.xml
Requirements
Python 3.10+
No runtime dependencies for the CLI (the standard library only)
Optional
mcppackage only if you use the MCP server
Related MCP server: Carto MCP Server
Install
macOS / Linux
git clone https://github.com/<your-account>/screenctx.git
cd screenctx
python3 -m venv .venv && source .venv/bin/activate
python3 -m pip install -e .Windows
PowerShell:
git clone https://github.com/<your-account>/screenctx.git
cd screenctx
py -m venv .venv
.\.venv\Scripts\Activate.ps1
py -m pip install -e .If
Activate.ps1is blocked, run once in the same PowerShell window:Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Command Prompt (cmd.exe):
git clone https://github.com/<your-account>/screenctx.git
cd screenctx
py -m venv .venv
.venv\Scripts\activate.bat
py -m pip install -e .After installing, the screenctx command is on your PATH. You can always run it without installing too:
python3 -m screenctx.cli --help # macOS/Linux
py -m screenctx.cli --help # WindowsTo also use the MCP server, install the extra:
python3 -m pip install -e ".[mcp]" # macOS/Linux
py -m pip install -e ".[mcp]" # WindowsCollect one screen
screenctx collect \
--root /path/to/spring-project \
--entry /customer/detail \
--out ./ctx \
--forceWindows:
screenctx collect --root C:\path\to\spring-project --entry /customer/detail --out .\ctx --forceWhat --entry accepts
--entry is repeatable and is resolved in this order (the first form that matches wins):
Form | Example | Notes |
File path (absolute or relative to |
| Any file: |
Java class (simple name or fully-qualified) |
| Any existing class — controller, |
Class method |
| Focuses on that method and its call chain. |
Route |
| Supports |
Notes:
Traversal is downstream-only. Starting from a controller class or a route gives the fullest screen context (it follows
return "view"down to the JSP/Thymeleaf and the full BLogic → DAO → XML chain). Starting from aBLogic/DAOonly collects what is downstream of it — it does not find its callers.There is no "bare view name" lookup:
--entry detailwill not resolve to a template. Use the screen's route (/customer/detail) or its file path instead.A simple class name matches every class with that name across the project; use the fully-qualified name to disambiguate.
Useful options
screenctx collect --root /path/to/project --entry /Demo100_list --out ./ctx --depth 4
screenctx collect --root /path/to/project --entry Demo100_02SearchAction#search --out ./ctx --no-copy
screenctx collect --root /path/to/project --entry /Demo100_list --out ./ctx --dry-runOption | Default | Meaning |
|
| Dependency traversal depth. |
|
| Stop after collecting N files. |
| none | Cap bytes included per file in |
| off | Do not auto-include |
| off | Do not follow form/action/fetch routes found in views/scripts. |
| off | Write reports only; do not copy files into |
| off | Overwrite the output directory (only if it is empty or screenctx-managed). |
| off | Analyze and print the file list without writing anything. |
--force will refuse to overwrite a directory that contains files screenctx did not write, and refuses to use the project root itself as --out.
Output
ctx/
context.md # one Markdown file ready to paste/upload to an AI tool
tree.txt # directory tree of collected files
files.txt # plain list of collected files
manifest.json # machine-readable reasons, routes, unresolved refs
unresolved.jsonl # only when unresolved refs exist
bundle/ # copied original files, preserving relative pathscontext.md includes the matched routes, the collected file tree, matched message lines, unresolved references, and each collected file with the reasons it was included and its content.
By default context.md does not truncate text files. For common utilities, DAO interfaces, Mapper/API-Mapper classes, and MyBatis/iBATIS SQLMap XML, it uses focused snippets when it can prove the called method or SQL statement; the full original file is still copied under bundle/.
bundle/ is useful when the AI tool can accept a folder/zip; context.md is useful when it only accepts a single text file.
Use from VS Code (MCP server)
screenctx ships an MCP server that exposes a collect_screen_context tool, so editors like VS Code (Copilot Chat / agent mode) can pull screen context on demand.
Install the MCP extra:
pip install -e ".[mcp]"The repo includes
.vscode/mcp.json:{ "servers": { "screenctx": { "type": "stdio", "command": "python", "args": ["-m", "screenctx.mcp_server"] } } }On Windows, use
"command": "py"ifpythonis not on your PATH. If you installed into a virtual environment, pointcommandat that interpreter (e.g..venv/bin/pythonor.venv\\Scripts\\python.exe) so themcppackage is found.Reload VS Code and start the
screenctxserver from the MCP view. The tool takes arootand a list ofentries(same forms as--entryabove) and returns thecontext.mdcontent directly.
You can also run the server standalone over stdio:
python -m screenctx.mcp_server
# or, after install:
screenctx-mcpDevelopment
python3 -m venv .venv && source .venv/bin/activate
python3 -m pip install -e ".[dev]"
pytestSmoke checks against fixtures / a real project:
./scripts/smoke_sqlmap_fixture.sh
./scripts/smoke_work_test.sh /path/to/your-spring-projectCurrent limits
Conservative static collector, not a full Java compiler.
Resolves common Spring annotations, Java type references, MyBatis XML namespaces, template includes, form actions, static assets, and message keys.
Does not execute Maven/Gradle, start Spring, or require network access.
Favors recall over perfect precision; some related base/framework files may be included.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zhuyihenzheng/screenctx'
If you have feedback or need assistance with the MCP directory API, please join our Discord server