Connecting a Remote MCP Server to OpenCode

To add an MCP server to OpenCode, just follow these steps:

  • Open opencode.json config file for editing, e.g. nano .config/opencode/opencode.json on macOS.
  • Add the following section:
"mcp": {
"my-remote-mcp": {
"type": "remote",
"url": "https://my-mcp-server.com",
"enabled": true,
"headers": {
"Authorization": "Bearer MY_API_KEY"
}
}
}

If opencode.json already has data in it, make sure to paste the above after schema and to add a , after the last closing braces, or opencode will error out.

Sources:

https://opencode.ai/docs/mcp-servers

Posted in Linux | Tagged , | Leave a comment

How to log vllm debug output to a file

Just a couple of environment variables and arguments, simply do the following:

export VLLM_LOGGING_LEVEL=DEBUG
export VLLM_DEBUG_LOG_API_SERVER_RESPONSE=TRUE

vllm serve \
--enable-log-requests \
--enable-log-outputs 2>&1 | tee vllm_server.log

That’s it, Enjoy!

Source:

  • Gemini!
Posted in Linux | Tagged , | Leave a comment

How to install Headless LM Studio on Linux

Simply run curl -fsSL https://lmstudio.ai/install.sh | bash

After you install, don’t forget to source your .bashrc file via source .bashrc so that you can run the lms command.

To bring it up, run lms daemon up

After it’s up, you can download a model using lms get, like this:

lms get MODEL_LINK@MODEL_QUANTIZATION

e.g.

lms get https://lmstudio.ai/models/nvidia/nemotron-3-nano-omni@q8_0

To load a model into memory:

lms load "nemotron-3-nano-omni" --context-length 128000

To start the server:

lms server start --port 1234

That’s it, Enjoy!

Sources:

Posted in Linux | Tagged , , , , | Leave a comment

How to Configure Tavily MCP Server in LM Studio

I needed to add a web search functionality to my models in LM Studio, so I simply had to add the Tavily MCP Server configuration to LM studio, along with my API key of course.

You simply click on Edit msp.json after clicking + Install on the top right-hand side:

then replace the values there with the following:

{
"mcpServers": {
"tavily-remote": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.tavily.com/mcp/?tavilyApiKey=tvly-prod-THE_REST_OF_YOUR_API_KEY"
]
}
}
}

Click on Save and you are good to go!

Don’t forget to enable it :), Enjoy!

Source:

Posted in Linux | Tagged , , , | Leave a comment

Count JSON objects in a file using jq

Simply run:

cat input_file.json | jq 'length'

For example:

{
"entity_id_01": {
"field_a": "value_a",
"field_b": "value_b",
"field_c": "This is a generic feedback message"
},
"entity_id_02": {
"field_a": "value_a",
"field_b": "value_b",
"field_c": "This is a generic feedback message"
}
}

Will return 2!

That’s it, Enjoy!

Sources:

Posted in Linux | Tagged , | Leave a comment