docs: Add testing documentation for MCP server endpoints
This commit is contained in:
parent
1b6cf6e6e1
commit
a4f5d96c93
77
TESTING.md
Normal file
77
TESTING.md
Normal file
@ -0,0 +1,77 @@
|
||||
# MCP Server Testing
|
||||
|
||||
The MCP server is now running at `http://home.ms:5000`. Here are the curl commands to test all endpoints:
|
||||
|
||||
## 1. Health Check
|
||||
```bash
|
||||
curl -X GET http://home.ms:5000/health
|
||||
```
|
||||
|
||||
## 2. Search Posts
|
||||
```bash
|
||||
curl -X GET "http://home.ms:5000/search?q=python&limit=5"
|
||||
```
|
||||
|
||||
## 3. Get Post Details
|
||||
```bash
|
||||
curl -X GET http://home.ms:5000/posts/xyz123
|
||||
```
|
||||
|
||||
## 4. Get Post Comments
|
||||
```bash
|
||||
curl -X GET "http://home.ms:5000/posts/xyz123/comments?limit=10"
|
||||
```
|
||||
|
||||
## 5. Get AI Summary
|
||||
```bash
|
||||
curl -X GET http://home.ms:5000/posts/xyz123/summary
|
||||
```
|
||||
|
||||
## 6. Get Trending Posts
|
||||
```bash
|
||||
curl -X GET "http://home.ms:5000/trending?limit=5"
|
||||
```
|
||||
|
||||
## 7. OpenAPI Specification
|
||||
```bash
|
||||
curl -X GET http://home.ms:5000/openapi.json
|
||||
```
|
||||
|
||||
## Example Response Format
|
||||
|
||||
### Search Response:
|
||||
```json
|
||||
{
|
||||
"posts": [
|
||||
{
|
||||
"id": "xyz123",
|
||||
"title": "Example Post Title",
|
||||
"subreddit": "example",
|
||||
"created_utc": 1634567890,
|
||||
"url": "http://reddit.com/r/example/comments/xyz123",
|
||||
"body": "Post content here...",
|
||||
"score": 123
|
||||
}
|
||||
],
|
||||
"after": "next_token",
|
||||
"query": "python",
|
||||
"limit": 5
|
||||
}
|
||||
```
|
||||
|
||||
### AI Summary Response:
|
||||
```json
|
||||
{
|
||||
"post_id": "xyz123",
|
||||
"summary": "AI-generated summary of the post and comments...",
|
||||
"post_title": "Example Post Title",
|
||||
"subreddit": "example"
|
||||
}
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
All AI-related endpoints require the API key in the Authorization header:
|
||||
```bash
|
||||
curl -X GET http://home.ms:5000/posts/xyz123/summary \
|
||||
-H "Authorization: Bearer 111"
|
||||
Loading…
x
Reference in New Issue
Block a user