This website requires JavaScript.
0
Issues
Pull Requests
Milestones
Explore
0
Create…
New Repository
New Migration
New Organization
public
Signed in as
public
Profile
Starred
Subscriptions
Settings
Help
Sign Out
yws
/
lc-mcp
Watch
1
Star
0
Fork
0
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
lc-mcp
/
scripts
/
or
Cancel
Edit File
Preview
Preview Changes
Spaces
Tabs
2
4
8
Wrap
No wrap
"""Exercise the installed stdio bridge with an actual MCP handshake and tool call.""" import argparse import json import os import subprocess import sys from pathlib import Path def main(): parser = argparse.ArgumentParser() parser.add_argument('tool', nargs='?', default='get_state') parser.add_argument('arguments', nargs='?', default='{}') parser.add_argument('--timeout', type=float, default=30) args = parser.parse_args() arguments = json.loads(args.arguments) root = Path(__file__).resolve().parents[1] requests = [ {'jsonrpc': '2.0', 'id': 1, 'method': 'initialize', 'params': { 'protocolVersion': '2024-11-05', 'capabilities': {}, 'clientInfo': {'name': 'lc-mcp-probe', 'version': '1'}}}, {'jsonrpc': '2.0', 'method': 'notifications/initialized'}, {'jsonrpc': '2.0', 'id': 2, 'method': 'tools/list'}, {'jsonrpc': '2.0', 'id': 3, 'method': 'tools/call', 'params': {'name': args.tool, 'arguments': arguments}}, ] process = subprocess.run( [sys.executable, '-X', 'utf8', str(root / 'lc_mcp' / 'bridge.py')], cwd=root, env=dict(os.environ, PYTHONUTF8='1'), input=''.join(json.dumps(r, ensure_ascii=False) + '\n' for r in requests), capture_output=True, text=True, encoding='utf-8', timeout=args.timeout, ) responses = [json.loads(line) for line in process.stdout.splitlines() if line.strip()] response = next((r for r in responses if r.get('id') == 3), None) if process.returncode or not response or 'error' in response: print(json.dumps({'ok': False, 'response': response, 'stderr': process.stderr}, ensure_ascii=False)) return 1 result = response['result'] data = json.loads(result['content'][0]['text']) print(json.dumps(data, ensure_ascii=False)) return 1 if result.get('isError') else 0 if __name__ == '__main__': sys.exit(main())
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
codex/feedback-unattended-setup-20261004
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel