45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
import json
|
|
import sys
|
|
import os
|
|
|
|
# Add project root to sys.path
|
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
|
|
|
try:
|
|
import mcp_client
|
|
except ImportError as e:
|
|
# Print the error to stderr to diagnose
|
|
print(f"ImportError in discovery: {e}", file=sys.stderr)
|
|
print("[]")
|
|
sys.exit(0)
|
|
|
|
def main():
|
|
specs = list(mcp_client.MCP_TOOL_SPECS)
|
|
|
|
# Add run_powershell (manually define to match ai_client.py)
|
|
specs.append({
|
|
"name": "run_powershell",
|
|
"description": (
|
|
"Run a PowerShell script within the project base_dir. "
|
|
"Use this to create, edit, rename, or delete files and directories. "
|
|
"The working directory is set to base_dir automatically. "
|
|
"stdout and stderr are returned to you as the result."
|
|
),
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"script": {
|
|
"type": "string",
|
|
"description": "The PowerShell script to execute."
|
|
}
|
|
},
|
|
"required": ["script"]
|
|
}
|
|
})
|
|
|
|
# Output as JSON array of FunctionDeclarations
|
|
print(json.dumps(specs, indent=2))
|
|
|
|
if __name__ == "__main__":
|
|
main()
|