Skip to content

[Bug]: Error: Method Not Allowed #115

Open

Description

@Joly0

Bug Description

Hey, i am trying to integrate deep-research with open-webui through mcpo and i am having issue using deep-research (other mcp´s through mcpo work).

So my docker-compose for deep-research looks like this:

deep-research:
    image: xiangfa/deep-research
    container_name: deep-research
    networks:
      - searxng
    environment:
      - OPENROUTER_API_KEY=sk-whatever
      - MCP_AI_PROVIDER=openrouter
      - MCP_SEARCH_PROVIDER=searxng
      - MCP_THINKING_MODEL=openai/o4-mini-high
      - MCP_TASK_MODEL=openai/gpt-4.1-nano
      - SEARXNG_API_BASE_URL=http://searxng:8080/

but when i try to research anything (either through mcpo or through open-webui directly) i get an error returned:
Method Not Allowed

deep-research logs show this:
[serp-query]: start
Method Not Allowed

Steps to Reproduce

  1. Install deep-research, searxng, mcpo and open-webui through docker-compose
  2. Configure deep-research in mcpo config file
  3. Try to use deep-research tool through mcpo
  4. see error

Expected Behavior

Deep- research should work

Screenshots

No response

Deployment Method

  • Docker
  • Vercel
  • Server

Desktop OS

No response

Desktop Browser

No response

Desktop Browser Version

No response

Smartphone Device

No response

Smartphone OS

No response

Smartphone Browser

No response

Smartphone Browser Version

No response

Additional Logs

No response

Activity

  1. Amery2010 commented on Jul 23, 2025

    @Amery2010
    Contributor

    The Method Not Allowed error comes from streamableHTTP.

    StreamableHTTP server endpoint: `/api/mcp`, transport type: `streamable-http`
    
    SSE server endpoint: `/api/mcp/sse`, transport type: `sse`

    You need to confirm that you have called the correct server endpoint with the correct transport type

  2. Joly0 commented on Jul 23, 2025

    @Joly0
    Author

    Yes, i did.
    See here the log of mcpo:

    Image showing that the sse endpoint is used and later this: Image
  3. Amery2010 commented on Jul 23, 2025

    @Amery2010
    Contributor

    This error should be reported by mcpo. I searched for mcpo's issues. This discussion may help you solve the problem.

    open-webui/open-webui#12875

  4. Joly0 commented on Jul 26, 2025

    @Joly0
    Author

    This error should be reported by mcpo. I searched for mcpo's issues. This discussion may help you solve the problem.

    open-webui/open-webui#12875

    Hey, i have opened an issue at the mcpo repo and they replied here open-webui/mcpo#214 (comment)

  5. Amery2010 commented on Jul 27, 2025

    @Amery2010
    Contributor

    The implementation of the /api/mcp/sse mode does have some problems. Since vercel cannot save the id if it is not connected to the kv cache, the state will be lost on some mcp clients because the corresponding session id cannot be found.

    Therefore I recommend you to use streamable-http mode instead of sse

  6. Joly0 commented on Jul 28, 2025

    @Joly0
    Author

    Not sure, but i really think this is a problem with deep-research, not with mcpo. I now tried to use metamcp and added deep-research there and metamcp provides an integrated mcp inspector and even there i get the "Method not allowed" error.

  7. Joly0 commented on Jul 28, 2025

    @Joly0
    Author

    In metamcp i added it like this:

    Image Metamcp says its connected: Image Even can find and use the tools: Image but when i try to run a tool i get this: Image
  8. Amery2010 commented on Jul 28, 2025

    @Amery2010
    Contributor

    I'm sorry, I don't have any solution at the moment. I don't know what caused this error, and there shouldn't be such an error in the project.

    I tested the service through the tool https://modelcontextprotocol.io/, and it was able to be called normally at that time.

  9. Joly0 commented on Jul 28, 2025

    @Joly0
    Author

    Could you provide me with a simple curl request that i could run inside the deep-research container so i can check if those are handled correctly?

  10. Amery2010 commented on Jul 28, 2025

    @Amery2010
    Contributor

    As far as I know, MCP services can only be called with the help of MCP clients. If you want to test whether the project is running properly, you can consider testing the data stream API /api/sse/live

    https://github.com/u14app/deep-research?tab=readme-ov-file#get-method

  11. Joly0 commented on Jul 28, 2025

    @Joly0
    Author

    Ok, so requesting this:

    /app # curl http://localhost:3000/api/mcp/sse/live?query=AI+trends+for+this+year&provider=openrouter&searchProvider=searxng
    /app # event: endpoint
    data: /api/mcp/sse/messages?sessionId=629eee65ae081a7fafde30141aa317d2
    
    
    

    shows this in the deep-research log:

      scheme_type: 0
    
    }
    
    }
    
    },
    
      hash: ''
    
    },
    
      url: 'http://0.0.0.0:3000/api/mcp/sse/live?query=AI+trends+for+this+year',
    
      bodyUsed: false,
    
      cache: 'default',
    
      credentials: 'same-origin',
    
      destination: '',
    
      headers: {
    
      accept: '*/*',
    
      host: 'localhost:3000',
    
      user-agent: 'curl/8.12.1',
    
      x-forwarded-for: '127.0.0.1',
    
      x-forwarded-host: 'localhost:3000',
    
      x-forwarded-port: '3000',
    
      x-forwarded-proto: 'http'
    
    },
    
      integrity: '',
    
      keepalive: false,
    
      method: 'GET',
    
      mode: 'cors',
    
      redirect: 'follow',
    
      referrer: 'about:client',
    
      referrerPolicy: '',
    
      signal: AbortSignal {
    
      [Symbol(kEvents)]: SafeMap(0) {},
    
      [Symbol(events.maxEventTargetListeners)]: 10,
    
      [Symbol(events.maxEventTargetListenersWarned)]: false,
    
      [Symbol(kAborted)]: false,
    
      [Symbol(kReason)]: undefined,
    
      [Symbol(kComposite)]: false
    
    }
    
    }
    
    [629eee65ae081a7fafde30141aa317d2] SSE stream started.
    
    [629eee65ae081a7fafde30141aa317d2] Sent 'endpoint' event: /api/mcp/sse/messages?sessionId=629eee65ae081a7fafde30141aa317d2
    

    but nothing more.

    Requesting this:

    /app # curl http://localhost:3000/api/sse/live?query=AI+trends+for+this+year&provider=openrouter&searchProvider=searxng
    /app # curl: (52) Empty reply from server
    
    

    shows this:

      x-forwarded-port: '3000',
    
      x-forwarded-proto: 'http'
    
    },
    
      integrity: '',
    
      keepalive: false,
    
      method: 'GET',
    
      mode: 'cors',
    
      redirect: 'follow',
    
      referrer: 'about:client',
    
      referrerPolicy: '',
    
      signal: AbortSignal {
    
      [Symbol(kEvents)]: SafeMap(0) {},
    
      [Symbol(events.maxEventTargetListeners)]: 10,
    
      [Symbol(events.maxEventTargetListenersWarned)]: false,
    
      [Symbol(kAborted)]: false,
    
      [Symbol(kReason)]: undefined,
    
      [Symbol(kComposite)]: false
    
    }
    
    }
    
    Client connected
    
     ⨯ [Error: failed to pipe response] {
    
      [cause]: Error: Unsupported Provider: 
    
          at H (.next/server/edge-chunks/334.js:182:3446)
    
          at Object.start (.next/server/app/api/sse/live/route.js:1:1333)
    
          at G (.next/server/app/api/sse/live/route.js:1:1135)
    
          at aF.do (.next/server/edge-chunks/955.js:5:13154)
    
          at <unknown> (.next/server/edge-chunks/955.js:5:17392)
    
          at <unknown> (.next/server/edge-chunks/955.js:17:4464)
    
    }
    
     ⨯ [Error: failed to pipe response] {
    
      [cause]: Error: Unsupported Provider: 
    
          at H (.next/server/edge-chunks/334.js:182:3446)
    
          at Object.start (.next/server/app/api/sse/live/route.js:1:1333)
    
          at G (.next/server/app/api/sse/live/route.js:1:1135)
    
          at aF.do (.next/server/edge-chunks/955.js:5:13154)
    
          at <unknown> (.next/server/edge-chunks/955.js:5:17392)
    
          at <unknown> (.next/server/edge-chunks/955.js:17:4464)
    
    }
    

    So the first endpoint shows/returns nothing to the requester, the second throws an "unsupported provider" error.

  12. Joly0 commented on Jul 28, 2025

    @Joly0
    Author

    Btw, also had to adjust the compose for deep-research and include the "hostname" environment variable, otherwise deep-research was not reachable from localhost, only through the ip.

    deep-research:
        image: xiangfa/deep-research
        hostname: deep-research
        networks:
          - mcp
          - metamcp-network
        environment:
          - OPENROUTER_API_KEY=sk-HIDDEN
          - MCP_AI_PROVIDER=openrouter
          - MCP_SEARCH_PROVIDER=searxng
          - MCP_THINKING_MODEL=openai/o4-mini-high
          - MCP_TASK_MODEL=openai/gpt-4.1-nano
          - SEARXNG_API_BASE_URL=http://searxng:8080/
          - HOSTNAME=0.0.0.0
    
  13. Joly0 commented on Jul 28, 2025

    @Joly0
    Author

    Btw, when i try ito do a deep-research through the webui of deep-research some parts work, but the information collection step fails with a cors error with searxng

  14. Amery2010 commented on Jul 29, 2025

    @Amery2010
    Contributor

    http://localhost:3000/api/sse/live?query=AI+trends+for+this+year&provider=openrouter&thinkingModel=openai/o4-mini-high&taskModel=openai/gpt-4.1-nano&searchProvider=searxng

    You need to set thinkingModel and taskModel in the parameters; otherwise, an error will occur because the appropriate model cannot be found.

    The Cors error of Searxng is caused by browser security issues. You can access it normally in the webUI through the server proxy mode.

  15. Joly0 commented on Jul 29, 2025

    @Joly0
    Author

    http://localhost:3000/api/sse/live?query=AI+trends+for+this+year&provider=openrouter&thinkingModel=openai/o4-mini-high&taskModel=openai/gpt-4.1-nano&searchProvider=searxng

    You need to set thinkingModel and taskModel in the parameters; otherwise, an error will occur because the appropriate model cannot be found.

    The Cors error of Searxng is caused by browser security issues. You can access it normally in the webUI through the server proxy mode.

    Even with your provided link, it doesnt work either:

    Image Image
  16. Joly0 commented on Aug 5, 2025

    @Joly0
    Author

    @Amery2010 so is there anything I can do or try or peovide to debug? I would really like to use deep research, but it doesn't work

  17. Amery2010 commented on Aug 6, 2025

    @Amery2010
    Contributor

    My openrouter account was previously deactivated due to arrears. I will apply for a new one today and will debug it according to your parameters today.

  18. Joly0 commented on Aug 12, 2025

    @Joly0
    Author

    Hey, any news? Had any luck to try this out yet?

  19. Amery2010 commented on Aug 12, 2025

    @Amery2010
    Contributor

    There is no solution yet

  20. Joly0 commented on Sep 5, 2025

    @Joly0
    Author

    Hey, its been a while, so any news on this issue? Have you had the chance to test it out?

  21. Joly0 commented on Sep 5, 2025

    @Joly0
    Author

    Ok ,was able to fix it. Here is the PR #136
    The problem was, that the requests added an additional /api to all requests going to openrouter, so the url would be https://openrouter.ai/api/api/v1.... whichw as wrong and resulted in the method not allowed error. I removed that, tested that in dev environmetn and in a self built container and it works

    Edit: Nvm, only solves the issue through the built-in webui, not for both mcp endpoints. There its still throwing the same error

  22. Joly0 commented on Sep 5, 2025

    @Joly0
    Author

    There is definitely something wrong with the configs. I just tried configuring - OPENROUTER_API_BASE_URL=https://openrouter.ai and that seems to work. But the documentation says:

    # (Optional) Server-side OpenRouter API Proxy URL. Default, `https://openrouter.ai`
    OPENROUTER_API_BASE_URL=
    

    so this should already be the default. But obviously it isnt. This is a bug, nothing else. Not a problem with documentation, nor anything. Its a bug. If the default is not the default as documented and doesnt work, its a bug.

  23. Amery2010 commented on Sep 6, 2025

    @Amery2010
    Contributor

    This is a documentation error. I submitted a fix yesterday. The actual path prefix is ​​https://openrouter.ai/api. You can find the relevant code in line 12 of the next.config.ts file.

    We are sorry that you have encountered a configuration error due to an error in the documentation.

  24. Joly0 commented on Sep 6, 2025

    @Joly0
    Author

    This is a documentation error. I submitted a fix yesterday. The actual path prefix is ​​https://openrouter.ai/api. You can find the relevant code in line 12 of the next.config.ts file.

    We are sorry that you have encountered a configuration error due to an error in the documentation.

    The actual actual path would be https://openrouter.ai/api/v1 according to the openrouter documentation. But this still doesnt answer or solve the problem, that the code adds an additional /api after the now default https://openrouter.ai/api which makes the URL invalid. As i have said, i have tested this.

    So the original correct value for the documentation was right https://openrouter.ai, but it wasnt correctly used in the backend code, which used https://openrouter.ai/api and added the additional /api to each request.

    So basically each request went (or goes to currently) https://openrouter.ai/api/api and not https://openrouter.ai/api due to this bug

  25. Joly0 commented on Sep 6, 2025

    @Joly0
    Author
    Image You see this error at the bottom? Request goes to `https://openrouter.ai/api/api/v1/models` and not `https://openrouter.ai/api/v1/models`.

    This is now in local mode and i quickly spun up the dev environment on my pc. And the value for the api base url is now the "correct" one with the /api at the end, according to the documentation. It works however, when i remove that /api at the end. So this is still an application error, not a documentation error.

  26. Amery2010 commented on Sep 7, 2025

    @Amery2010
    Contributor

    The default API prefix I mentioned is for backend server use. On the frontend, simply enter https://openrouter.ai/, and the system will complete the subsequent path /api/v1.

    Weren't you using MCP services before? MCP services require environment variables to implement backend server logic.

  27. Joly0 commented on Sep 7, 2025

    @Joly0
    Author

    I am using various MCP Servers.

    Also, you now mention, that i should enter https://openrouter.ai/, but according to the backend code of you application and the documentation and the config file, the default now is https://openrouter.ai/api instead. That's what I am trying to tell you. The default value, without me entering anything, is wrong. Same for the documentation, which you have "fixed".

    Don't you understand the problem here?

  28. Amery2010 commented on Sep 9, 2025

    @Amery2010
    Contributor

    I understand what you mean. I did have a problem with the unification of the APIs on both ends. I submitted a small bugfix and made it compatible with the default API path of OpenRouter.

  29. Joly0 commented on Sep 15, 2025

    @Joly0
    Author

    It looks like the issue is resolved when running through the api endpoint, but not when running throuhg the webui.
    In local mode, this normally goes through the configured and correct api endpoint for openrouter
    Image
    but when running in proxy mode (even when the correct endpoint for openrouter is configured and works via the api endpoint /api/mcp or /api/mcp/sse) then it doesnt work

    Image Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions