Loop
How it worksThe loopWhy LoopPricingDocs
guide Dify · MCP server · HTTP Request

Use Loop with Dify.

Add real-time local restaurant data to any Dify chatflow or workflow. Use Loop's MCP server for one-click tool access in Agent nodes or drop in HTTP Request nodes to call the REST API in any Dify version. No API key required on the free tier.

option 1 MCP server — one URL, all four tools

The fastest setup. Dify discovers Loop's tools automatically — no per-tool configuration needed. The Agent node decides when to call search, get_details, verify, and report based on the conversation.

Setup path: Build → MCP Tools → Add MCP Server → https://stayinloop.dev/mcp
MCP server setup + Agent node config
# Option 1 — MCP server (current Dify versions)
# Build → MCP Tools → Add MCP Server
# Server URL: https://stayinloop.dev/mcp
#
# Dify discovers all four tools automatically:
#   search       — find restaurants by query + filters
#   get_details  — full record + result_token
#   verify       — re-check a specific record live
#   report       — feed outcome back to improve future searches
#
# In your chatflow or workflow:
# 1. Add an Agent node
# 2. Under Tools, enable the Loop tools
# 3. The agent calls them based on user intent — no additional config
option 2 HTTP Request nodes (any Dify version)

For Dify versions without MCP support, or when you want deterministic workflow control. Configure an HTTP Requestnode pointing at Loop's REST API. Use a Variable Extractor node to pull fields out of the JSON response for downstream LLM or conditional nodes.

Workflow: User input → HTTP Request (GET /v1/search) → Variable Extractor → LLM node → response
HTTP Request node — search
# Option 2 — HTTP Request node (any Dify version)
# Add an HTTP Request node to your workflow:
#
# Method: GET
# URL:    https://api.stayinloop.dev/v1/search
# Params:
#   q        = {{#sys.query#}}          ← user query variable
#   location = Kreuzberg, Berlin
#   limit    = 5
#
# Response variable: loop_results
# Then connect to a Variable Extractor node:
#   Extract: results → array of restaurant records
#   Each record has: name, address, confidence,
#   restaurant.cuisine, restaurant.outdoor_seating

After the user acts on the result, report the outcome to close the feedback loop:

HTTP Request node — POST /v1/report
# Report outcome after the user acts:
#
# HTTP Request node — POST /v1/report
# Method:       POST
# URL:          https://api.stayinloop.dev/v1/report
# Content-Type: application/json
# Body:
{
  "result_token": "{{#loop_details.result_token#}}",
  "outcome":      "{{#sys.outcome#}}"
}
# outcome: correct · wrong · booked · closed · other
#
# This mutates the record's confidence score in Loop's
# database — the next agent searching gets better data.
quick reference
EndpointMethodKey params
/v1/searchGETq, location, limit
/v1/details/:idGETresult_id in path
/v1/verify/:idGETclaim query param (optional)
/v1/reportPOSTresult_token, outcome

Full schema: api.stayinloop.dev/v1/openapi.json

common questions

Does my Dify version support MCP?

Current Dify versions (cloud dify.ai and self-hosted) support MCP servers via Build → MCP Tools → Add MCP Server. If you don't see that menu, use the HTTP Request node approach — it works on any Dify version.

Does Loop work in Dify Chatflow and Workflow modes?

Yes. Both modes support Agent nodes (for MCP) and HTTP Request nodes (for REST). Chatflow is best when the search query comes from a live conversation; Workflow is best for scheduled or trigger-based pipelines where the query is known at design time.

What is the result_token and when does it expire?

The result_token is returned by get_details() and is required to call report(). It is a signed HMAC token that expires after 30 minutes. In Dify workflows, pass the token from the get_details HTTP Request node output to the report HTTP Request node body.

Is an API key required?

No. The free tier requires no authentication header. Higher-volume projects can request a key at stayinloop.dev/#pricing. When using a key, add it as an Authorization: Bearer <key> header in the HTTP Request node.

← All guidesn8n guidePython guide