FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Added demo script to start the MCP server in headless mode · pnfsoftware/jeb-samplecode@096e3ef · GitHub

Repository navigation

Commit 096e3ef

Browse files
committed
Added demo script to start the MCP server in headless mode
1 parent 5dd0f7e commit 096e3ef

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎scripts/HeadlessMCP.py‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL