Focused browser example for the MCP integration in ClientAgentJS.
- saving an MCP server configuration
- calling
initializeMcp() - calling
listMcpTools() - calling
callMcpTool() - enabling an MCP server in the active profile
- running
ask()with MCP tools available to the model
Build the library first:
npm run buildStart the example MCP server:
cd scripts
python3 mcp_server.pyServe the repository root with a static server and open:
examples/mcp-tools/index.html
Example:
python3 -m http.server 8000Then open:
http://localhost:8000/examples/mcp-tools/
- Click
Save MCP Server. - Click
InitializeorList toolsto verify connectivity. - Click
Create Demo Profileif you have Ollama running athttp://localhost:11434/v1. - Run
ask() with MCP.
If you are not using Ollama, open the profile panel and create an active OpenAI-compatible profile manually, then enable the saved MCP server in that profile.
See license: ClientAgentJS