| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,26 @@ | |||
| 1 | + from com.pnfsoftware.jeb.client.api import IScript | ||
| 2 | + from com.pnfsoftware.jeb.client.mcp import JebMcpServerInstance | ||
| 3 | + import time | ||
| 4 | + """ | ||
| 5 | + This script opens or creates a new JEB project, and start the MCP server. | ||
| 6 | + Connect to the MCP server with the AI tool of your choice. | ||
| 7 | + | ||
| 8 | + How to run, e.g. on Windows: | ||
| 9 | + $ jeb_wincon.bat -c --script=HeadlessMCP.py -- INPUT_FILE_PATH | ||
| 10 | + | ||
| 11 | + Note: you need to provide an input file, as the JEB MCP server expects an opened project. | ||
| 12 | + As of jeb-mcp-server v1.1.0 (JEB 5.40), there is no tool to create or load projects. | ||
| 13 | + """ | ||
| 14 | + class HeadlessMCP: | ||
| 15 | + def run(self, ctx): | ||
| 16 | + if not ctx.getArguments(): | ||
| 17 | + print('Provide an input file or JDB2 after --') | ||
| 18 | + return | ||
| 19 | + inputpath = ctx.getArguments()[0] | ||
| 20 | + ctx.open(inputpath) | ||
| 21 | + print('Starting the MCP server...') | ||
| 22 | + mcp = JebMcpServerInstance.start() # https://pnfsoftware.com/jeb/apidoc/com/pnfsoftware/jeb/client/mcp/JebMcpServerInstance.html | ||
| 23 | + print('%s v%s is listening on %s:%d%s' % ( | ||
| 24 | + mcp.getName(), mcp.getVersion(), mcp.getHostname(), mcp.getPort(), mcp.getEndpoint())) | ||
| 25 | + input('Press Enter to stop the MCP server...') | ||
| 26 | + JebMcpServerInstance.stop() | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments