A language model can use a tool when it needs a current value, such as the time. The LM Studio API can call a configured Model Context Protocol (MCP) server during a chat request and return the tool's result.
LM Studio starts the local Time server from its entry in mcp.json. A tool-capable model can access that server as the mcp/time plugin. The get_current_time tool reads the system clock in the timezone passed by the model.
A client with permission to call configured MCP servers can invoke the configured executables with your user account's privileges. With only the trusted local Time server configured, the chat request can limit the model to a single Time tool.
Configured MCP access through the API requires LM Studio 0.4.0 or later. Start with a stopped Model Server and a loaded model that supports tool use. The request uses the loaded model ID qwen2.5-1.5b-instruct. The Time server setup shows how to create the time entry and check that get_current_time appears in Program. The API token setup shows how to enable Require Authentication.
The active mcp.json must contain only the trusted local time entry under mcpServers before you enable configured-server access. The Time server setup preserves existing entries. If your configuration includes other servers, a separate LM Studio installation in a VM lets you use a Time-only configuration while preserving your existing entries.
Steps to call a configured MCP server through the LM Studio API:
- Open Server Settings in the Local Server pane of Model Server.

- Confirm that Server Settings limits access to authenticated local clients.
Configured-server access requires Require Authentication on, with Serve on Local Network, Allow per-request MCPs and Enable CORS off for this request.
- Turn on Allow calling servers from mcp.json in Server Settings.
The API token setup applies from Manage Tokens through the step that sets Allow per-request remote MCP servers to Deny. The configured-server permission on the token form is set in the next step.
- Set Allow calling servers from mcp.json to Allow on the token form.
If the row already shows Allow, leave it selected. The remote permission stays on Deny.
Related: How to create an API token in LM Studio - Select Create token.
The linked token setup covers copying and storing the one-time value securely and closing the dialogs.
- Start the API server with the Status switch in Local Server.

- Confirm that Reachable at shows http://127.0.0.1:1234.
The token is sent directly to the local server. If the port differs from 1234, use the displayed loopback port in both requests.
- Send an unauthenticated model-list request from Bash on the same computer.
curl --disable \ --noproxy '*' \ --silent --show-error \ --include \ --max-time 10 \ http://127.0.0.1:1234\ /api/v1/models
- Confirm that the loopback model-list request returns HTTP/1.1 401 Unauthorized.
Only enter a bearer token after this request to the same loopback listener returns HTTP 401. If it returns HTTP 200 without a token, stop the server and restore Require Authentication before retrying the anonymous request.
- Set the JSON chat payload in the same Bash shell.
request='{ "model": '\ '"qwen2.5-1.5b-instruct", "input": "Call '\ 'get_current_time '\ 'with timezone UTC.", "integrations": [{ "type": "plugin", "id": "mcp/time", "allowed_tools": '\ '["get_current_time"] }], "stream": false, "store": false, "temperature": 0, "max_output_tokens": 128 }'
The quoted segments form one JSON string. The model value is the API identifier shown for the loaded model. The plugin integration selects the time entry and allowed_tools exposes only get_current_time. Setting store to false prevents LM Studio from saving the API chat for follow-up requests.
- Start the authenticated chat request with the concealed token prompt.
( set +xa unset -v token || exit 1 IFS= read -rs -p \ 'API token: ' token \ || exit 1 printf '\n' >&2 printf 'Authorization:'\ ' Bearer %s\n' "$token" | curl --disable --noproxy \ '*' -sSi -m 90 -H @- \ -H 'Content-Type:'\ ' application/json' \ --data "$request" \ http://127.0.0.1:1234\ /api/v1/chat )-H @- gives curl the bearer header through standard input. The subshell clears any inherited token variable and turns off automatic export before reading the value. The token stays out of curl's environment and process arguments and out of shell command history. --noproxy '*' sends the request directly to loopback.
- Submit the API token at the concealed API token: prompt.
If LM Studio asks for approval, allow only the get_current_time call for UTC.
- Confirm that the HTTP 200 response contains the get_current_time call from mcp/time with a UTC timestamp in the tool output.
HTTP/1.1 200 OK ##### snipped ##### "type": "tool_call", "tool": "get_current_time", "arguments": { "timezone": "UTC" }, ##### snipped ##### "provider_info": { "plugin_id": "mcp/time", "type": "plugin" } ##### snipped #####The tool_call item in the response's output array shows the requested timezone in arguments. The item's own output string encodes a Time text block. This excerpt shows the returned datetime field from the decoded text. Its value should be close to the time of your request.
"datetime": "2026-11-20T21:09:15+00:00"