> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://api.docs.modulards.com/modular-ds-public-api/oauth/oauth-register-client-rfc-7591/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.docs.modulards.com/_mcp/server. # OAuth · Register client (RFC 7591) POST https://api.modulards.com/oauth/register Content-Type: application/json RFC 7591 dynamic client registration. Answers **201** with the client document. Unauthenticated and throttled to 10 requests/min per IP. **Redirect URIs** (`redirect_uris`, required, 1 to 5 entries). Each one is parsed and compared whole: - `https` (or `http`) whose scheme, host and port equal an allowed domain exactly - a subdomain, another port or a longer host is not the same domain. - `http` on a loopback host (`127.0.0.1`, `[::1]`, `localhost`) on any port, for native and desktop clients (RFC 8252). - An allowed private-use scheme with a host, such as `cursor://anysphere.cursor-retrieval/oauth/callback`. - Never a comma, `@`, backslash, whitespace, user, password or fragment. Anything else answers **400** `invalid_redirect_uri`. **Client name** (`client_name`, optional): at most 100 characters, no control characters; otherwise **400** `invalid_client_metadata`. The approval screen shows it next to the address the authorization will be sent to. Registered clients are public (PKCE S256, no secret) and own no user. Registrations that never obtained a token are removed after 30 days. Host root, no `/api` prefix. Reference: https://api.docs.modulards.com/modular-ds-public-api/oauth/oauth-register-client-rfc-7591 ## Request ### Body (application/json) This endpoint expects an object. - `client_name` (string, optional) - `redirect_uris` (list of string, optional) ## Response ### 201 201 Created - `client_id` (string, optional) - `grant_types` (list of string, optional) - `redirect_uris` (list of string, optional) - `response_types` (list of string, optional) - `scope` (string, optional) - `token_endpoint_auth_method` (string, optional) ## Errors ### 400 Bad Request Error 400 Invalid redirect URI - `error` (string, optional) - `error_description` (string, optional) ## Examples ### 201 Created **Response** ```json { "client_id": "9d7f2c1e-4b3a-4f8e-9c2d-1a5b6e7f8a90", "grant_types": [ "authorization_code", "refresh_token" ], "redirect_uris": [ "https://claude.ai/api/mcp/auth_callback" ], "response_types": [ "code" ], "scope": "mcp:use", "token_endpoint_auth_method": "none" } ``` **SDK Code** ```python 201 Created import requests url = "https://api.modulards.com/oauth/register" response = requests.post(url) print(response.json()) ``` ```javascript 201 Created const url = 'https://api.modulards.com/oauth/register'; const options = {method: 'POST'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go 201 Created package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.modulards.com/oauth/register" req, _ := http.NewRequest("POST", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby 201 Created require 'uri' require 'net/http' url = URI("https://api.modulards.com/oauth/register") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) response = http.request(request) puts response.read_body ``` ```java 201 Created import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.modulards.com/oauth/register") .asString(); ``` ```php 201 Created request('POST', 'https://api.modulards.com/oauth/register'); echo $response->getBody(); ``` ```csharp 201 Created using RestSharp; var client = new RestClient("https://api.modulards.com/oauth/register"); var request = new RestRequest(Method.POST); IRestResponse response = client.Execute(request); ``` ```swift 201 Created import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/oauth/register")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### OAuth · Register client (RFC 7591) **Request** ```json { "client_name": "Claude", "redirect_uris": [ "https://claude.ai/api/mcp/auth_callback" ] } ``` **Response** ```json { "client_id": "9d7f2c1e-4b3a-4f8e-9c2d-1a5b6e7f8a90", "grant_types": [ "authorization_code", "refresh_token" ], "redirect_uris": [ "https://claude.ai/api/mcp/auth_callback" ], "response_types": [ "code" ], "scope": "mcp:use", "token_endpoint_auth_method": "none" } ``` **SDK Code** ```python OAuth · Register client (RFC 7591) import requests url = "https://api.modulards.com/oauth/register" payload = { "client_name": "Claude", "redirect_uris": ["https://claude.ai/api/mcp/auth_callback"] } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript OAuth · Register client (RFC 7591) const url = 'https://api.modulards.com/oauth/register'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"client_name":"Claude","redirect_uris":["https://claude.ai/api/mcp/auth_callback"]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go OAuth · Register client (RFC 7591) package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.modulards.com/oauth/register" payload := strings.NewReader("{\n \"client_name\": \"Claude\",\n \"redirect_uris\": [\n \"https://claude.ai/api/mcp/auth_callback\"\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby OAuth · Register client (RFC 7591) require 'uri' require 'net/http' url = URI("https://api.modulards.com/oauth/register") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"client_name\": \"Claude\",\n \"redirect_uris\": [\n \"https://claude.ai/api/mcp/auth_callback\"\n ]\n}" response = http.request(request) puts response.read_body ``` ```java OAuth · Register client (RFC 7591) import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.modulards.com/oauth/register") .header("Content-Type", "application/json") .body("{\n \"client_name\": \"Claude\",\n \"redirect_uris\": [\n \"https://claude.ai/api/mcp/auth_callback\"\n ]\n}") .asString(); ``` ```php OAuth · Register client (RFC 7591) request('POST', 'https://api.modulards.com/oauth/register', [ 'body' => '{ "client_name": "Claude", "redirect_uris": [ "https://claude.ai/api/mcp/auth_callback" ] }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp OAuth · Register client (RFC 7591) using RestSharp; var client = new RestClient("https://api.modulards.com/oauth/register"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"client_name\": \"Claude\",\n \"redirect_uris\": [\n \"https://claude.ai/api/mcp/auth_callback\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift OAuth · Register client (RFC 7591) import Foundation let headers = ["Content-Type": "application/json"] let parameters = [ "client_name": "Claude", "redirect_uris": ["https://claude.ai/api/mcp/auth_callback"] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.modulards.com/oauth/register")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```