Anyone have any advice on how to setup an MCP serv...
# questions
a
Anyone have any advice on how to setup an MCP server in OpenHands using the web ui? Starting clean slate and noticed I'm initially asked to setup the LLM and I can set it up to use LMStudio without issue. I'm trying to add Context7 as an MCP Server using SHTTP, and once I click save it does erase the llm_base_url param, but I then just re-enter it on the LLM page and click save again, but after that it seems like the LLM is not made aware of the nearly configured MCP Server. Curious if anyone has any suggestions.
πŸ‘€ 1
g
You are referencing the cloud
<http://app.all-hands.dev|app.all-hands.dev>
correct?
Or running the GUI locally?
a
locally
g
I will run GUI locally and see if I can help. Otherwise I'll pull OpenHands to help πŸ‘
bout to hop on a call but will come back to this mike also what os are you on? mac, linux, windows? ty
a
I'm on mac, thanks. I have a ticket about losing settings here that has details on my setup. https://github.com/OpenHands/OpenHands/issues/13242 Also, I noticed that when you add an MCP Server and save, it nulls out a few values in settings.json, as an FYI.
ty 1
πŸ‘€ 1
w
I find adding MCP servers frustrating because it's hard to know what is happening when you send a request and it isn't working. I know it took a couple of loops to get an MCP server with the openhands cloud. (I know this is unrelated, but wanted to vent πŸ˜€)
sadblob 1
a
Did you getting it working locally? Or just the cloud?
a
I was doing the cloud
g
Yeah mine failed initially but then worked after i refreshed my openhands key for local gui. Taking a look at your ticke tnow mike
a
Let me know if there is anything I can do to help
πŸ‘ 1
g
there's a bug but the fix looks simple enough, i'll keep you posted πŸ‘
a
awesome, thanks
πŸ‘€ 1
s
@abundant-librarian-48157 and @gentle-apple-32922 I posted a PR to fix this about same time you created issue. Please see PR #13250.
lol. I looked up Jamie's duplicate fix. My PR is 13225. Please close my if you prefer.
😯 1
g
Thank you, Chris! I went ahead and alerted the team of a PR review in #C06QT0AGY4W
πŸ™ 1
a
What's the best way for me to get the fix?
g
For now, I mean you could clone the branch and run that branch locally thinky spin
a
Do you have a quick guide on that? Doesn't seem like a bad thing to do if I want to try using this more.
πŸ‘€ 1
g
According to OpenHands > Here's the quick way to run any branch locally: >
Copy code
# Clone the repo
> git clone <https://github.com/cbagwell/OpenHands.git>
> cd OpenHands
> 
> # Checkout the PR branch (using the branch name from the PR)
> git fetch origin
> git checkout cbagwell:fix/llm-base-url-wipe-mcp
> 
> # Run locally
> export INSTALL_DOCKER=0
> export RUNTIME=local
> make build && make run
> Settings file location:
~/.openhands/settings.json
on your Mac > Then open http://localhost:3000 and test adding an MCP server - your custom
llm_base_url
should now be preserved!
a
I'm not seeing that branch
keyword search for preserve only shows up fix-llm-api-key-preservation
g
i adjust the above commands originally it assumed the fix was on the openhands repo but it's on chris's i think you'll have to clone and use Chris's
a
Sure, working on building now, getting different dependency errors I'm working through. Good practice.
Pasting logs to gemeni and getting errors with tmux. It’s like whack-a-mole! You fixed the first line, but now the very next line is hitting another
libtmux
deprecation. The version of OpenHands source code you are using is simply older than the
libtmux
library currently installed. Since you are running version 1.4.0 (which is quite new), this is likely an oversight in the repo's current "local runtime" implementation. To get this running, we need to perform one more code edit in the same file.
s
I find building the main app container easiest to build and then run that image name instead. You won't have these dependencies issues anyways. Run this from top level of openhands repo:
Copy code
docker build -f containers/app/Dockerfile -t test-openhands .
a
Thanks, I finally got the webui to work, but getting some random errors in the background I would still need to address building the source
will try the docker way as I'm sure it's going to be contained and easier
@salmon-lock-64866 Thanks, your fix works for me. Now I just need to figure out how to get the mcp servers to work. I tried to add context7, the logs seem to show it getting recognized, but the llm doesn't seem to be aware of it.
nevermind, it looks like it can see it. 1. shttp_9115111a_resolve_library_id - Resolve package/product name to Context7-compatible library ID 2. shttp_9115111a_query_docs - Retrieve documentation and code examples from Context7
Thanks for all the help.
s
I also find that if I add a 3rd stdio mcp server that it breaks things (takes longer than 30 second timeout that also doesn't gracefully recover). You might hit that next as well.
a
Good to know. I'm new to this so I'm just playing around and seeing what I can do with a local llm. If you have anything I should reference as I'm getting started that would be great. Haven't used mcp servers yet, really, and all my vibe coding has been with the kiro ide.