Skip to content

Commit 107b779

Browse files
committed
Fix /mcp route
1 parent 5b18bb7 commit 107b779

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

examples/mcp-oauth/app/mcp.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
handle(req, token_info)
1313
}
1414

15+
# @param req [Syntropy::Request]
1516
def valid_token?(req)
1617
token = req.auth_bearer_token
1718
return false if !token
@@ -50,7 +51,7 @@ def handle(req, token_info)
5051

5152
send(sym, req, json, token_info)
5253
rescue Syntropy::ValidationError => e
53-
if (m = e.message.match(</(.+)\: (.+)/))
54+
if (m = e.message.match(/(.+)\: (.+)/))
5455
type, message = m[1], m[2]
5556
else
5657
type, message = 'INVALID_REQUEST', e.message
@@ -59,10 +60,10 @@ def handle(req, token_info)
5960
end
6061

6162
ERROR_CODES = {
62-
'INVALID_REQUEST' => -32600
63-
'METHOD_NOT_FOUND' => -32601
64-
'INVALID_PARAMS' => -32602
65-
'INTERNAL_ERROR' => -32603
63+
'INVALID_REQUEST' => -32600,
64+
'METHOD_NOT_FOUND' => -32601,
65+
'INVALID_PARAMS' => -32602,
66+
'INTERNAL_ERROR' => -32603,
6667
'PARSE_ERROR' => -32700
6768
}
6869

@@ -80,6 +81,5 @@ def respond_error(req, json, error_type, error_message)
8081
)
8182
end
8283

83-
def handle_initialize(
84-
85-
)
84+
def handle_initialize()
85+
end

0 commit comments

Comments
 (0)