Update MCP server CLI and example script to include card_table_id in request handling
- Add card_table_id to the required properties in MCPServer class. - Modify the move_column method to retrieve card_table_id from arguments. - Refactor subprocess call in card_table_example.py to use subprocess.run for better error handling.
This commit is contained in:
@@ -25,20 +25,20 @@ def send_mcp_request(method, params=None):
|
||||
}
|
||||
|
||||
# Run the MCP server with the request
|
||||
process = subprocess.Popen(
|
||||
result = subprocess.run(
|
||||
[sys.executable, "mcp_server_cli.py"],
|
||||
stdin=subprocess.PIPE,
|
||||
input=json.dumps(request),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True
|
||||
)
|
||||
|
||||
stdout, stderr = process.communicate(input=json.dumps(request))
|
||||
|
||||
if process.returncode != 0:
|
||||
print(f"Error: {stderr}")
|
||||
if result.returncode != 0:
|
||||
print(f"Error: {result.stderr}")
|
||||
return None
|
||||
|
||||
stdout = result.stdout
|
||||
|
||||
try:
|
||||
return json.loads(stdout)
|
||||
except json.JSONDecodeError as e:
|
||||
|
||||
Reference in New Issue
Block a user