webcite-mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +200 -0
- package/dist/api-client.d.ts +136 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +93 -0
- package/dist/api-client.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +437 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# WebCite MCP Server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for WebCite - enables Claude to verify factual claims against authoritative sources.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
| Tool | Description | Credits |
|
|
8
|
+
|------|-------------|---------|
|
|
9
|
+
| `verify_claim` | Full fact verification with stance analysis and verdict | 2-4 |
|
|
10
|
+
| `search_sources` | Quick citation search without analysis | 2 |
|
|
11
|
+
| `list_citations` | List your past verifications | Free |
|
|
12
|
+
| `get_citation` | Get details of a specific verification | Free |
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### For Claude Desktop
|
|
17
|
+
|
|
18
|
+
Add to your `claude_desktop_config.json`:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"webcite": {
|
|
24
|
+
"command": "npx",
|
|
25
|
+
"args": ["-y", "@webcite/mcp-server"],
|
|
26
|
+
"env": {
|
|
27
|
+
"WEBCITE_API_KEY": "wc_your_api_key_here"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### For Claude Code
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Install globally
|
|
38
|
+
npm install -g @webcite/mcp-server
|
|
39
|
+
|
|
40
|
+
# Or run directly with npx
|
|
41
|
+
WEBCITE_API_KEY=wc_xxx npx @webcite/mcp-server
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Getting Your API Key
|
|
45
|
+
|
|
46
|
+
1. Sign up at [webcite.co](https://webcite.co)
|
|
47
|
+
2. Go to [API Keys](https://webcite.co/api-keys)
|
|
48
|
+
3. Create a new API key
|
|
49
|
+
4. Add it to your MCP configuration
|
|
50
|
+
|
|
51
|
+
## Usage Examples
|
|
52
|
+
|
|
53
|
+
### Verify a Claim
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
User: Use WebCite to verify: "The Great Wall of China is visible from space"
|
|
57
|
+
|
|
58
|
+
Claude: [Calls verify_claim tool]
|
|
59
|
+
|
|
60
|
+
# Fact Check: "The Great Wall of China is visible from space"
|
|
61
|
+
|
|
62
|
+
## Verdict: ✗ CONTRADICTED
|
|
63
|
+
**Confidence:** 92%
|
|
64
|
+
**Summary:** Multiple authoritative sources confirm this is a common misconception.
|
|
65
|
+
|
|
66
|
+
**Source Breakdown:**
|
|
67
|
+
- Supporting: 0
|
|
68
|
+
- Contradicting: 4
|
|
69
|
+
- Neutral: 1
|
|
70
|
+
|
|
71
|
+
## Sources
|
|
72
|
+
|
|
73
|
+
1. **NASA - Great Wall of China**
|
|
74
|
+
URL: https://www.nasa.gov/...
|
|
75
|
+
Stance: ✗ contradicts (95% confidence)
|
|
76
|
+
Credibility: 98/100
|
|
77
|
+
Analysis: NASA explicitly states the wall is not visible from low Earth orbit...
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Search for Sources
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
User: Search for sources about "quantum computing breakthroughs 2024"
|
|
84
|
+
|
|
85
|
+
Claude: [Calls search_sources tool]
|
|
86
|
+
|
|
87
|
+
# Search Results: "quantum computing breakthroughs 2024"
|
|
88
|
+
|
|
89
|
+
Found 8 sources:
|
|
90
|
+
|
|
91
|
+
1. **Nature - Quantum Error Correction Milestone**
|
|
92
|
+
URL: https://nature.com/...
|
|
93
|
+
Credibility: 95/100
|
|
94
|
+
Snippet: "Researchers achieved a significant breakthrough in..."
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Review Past Verifications
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
User: Show my recent fact-checks
|
|
101
|
+
|
|
102
|
+
Claude: [Calls list_citations tool]
|
|
103
|
+
|
|
104
|
+
# Your Verification History
|
|
105
|
+
|
|
106
|
+
Page 1 of 3 (28 total)
|
|
107
|
+
|
|
108
|
+
1. **The Earth is 4.5 billion years old**
|
|
109
|
+
ID: abc123...
|
|
110
|
+
Date: Jan 30, 2025
|
|
111
|
+
|
|
112
|
+
2. **Coffee causes cancer**
|
|
113
|
+
ID: def456...
|
|
114
|
+
Date: Jan 29, 2025
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Tool Details
|
|
118
|
+
|
|
119
|
+
### verify_claim
|
|
120
|
+
|
|
121
|
+
Full fact verification with optional stance analysis and verdict generation.
|
|
122
|
+
|
|
123
|
+
**Parameters:**
|
|
124
|
+
- `claim` (required): The factual claim to verify
|
|
125
|
+
- `include_stance` (optional, default: true): Include stance analysis per source (+1 credit)
|
|
126
|
+
- `include_verdict` (optional, default: true): Generate overall verdict (+1 credit)
|
|
127
|
+
- `decompose_claim` (optional, default: false): Break complex claims into sub-claims
|
|
128
|
+
|
|
129
|
+
**Credit Cost:**
|
|
130
|
+
- Base search: 2 credits
|
|
131
|
+
- With stance: +1 credit
|
|
132
|
+
- With verdict: +1 credit
|
|
133
|
+
- Full verification: 4 credits
|
|
134
|
+
|
|
135
|
+
### search_sources
|
|
136
|
+
|
|
137
|
+
Quick citation search without analysis - returns raw sources.
|
|
138
|
+
|
|
139
|
+
**Parameters:**
|
|
140
|
+
- `query` (required): Search query or claim
|
|
141
|
+
- `limit` (optional, default: 10): Max sources to return (1-20)
|
|
142
|
+
|
|
143
|
+
**Credit Cost:** 2 credits
|
|
144
|
+
|
|
145
|
+
### list_citations
|
|
146
|
+
|
|
147
|
+
List your past verification results.
|
|
148
|
+
|
|
149
|
+
**Parameters:**
|
|
150
|
+
- `page` (optional, default: 1): Page number
|
|
151
|
+
- `limit` (optional, default: 10): Results per page (max 50)
|
|
152
|
+
- `thread_id` (optional): Filter by conversation thread
|
|
153
|
+
|
|
154
|
+
**Credit Cost:** Free
|
|
155
|
+
|
|
156
|
+
### get_citation
|
|
157
|
+
|
|
158
|
+
Get full details of a specific verification.
|
|
159
|
+
|
|
160
|
+
**Parameters:**
|
|
161
|
+
- `citation_id` (required): The citation ID to retrieve
|
|
162
|
+
|
|
163
|
+
**Credit Cost:** Free
|
|
164
|
+
|
|
165
|
+
## Environment Variables
|
|
166
|
+
|
|
167
|
+
| Variable | Description | Default |
|
|
168
|
+
|----------|-------------|---------|
|
|
169
|
+
| `WEBCITE_API_KEY` | Your WebCite API key (required) | - |
|
|
170
|
+
| `WEBCITE_API_URL` | API base URL | `https://api.webcite.co` |
|
|
171
|
+
|
|
172
|
+
## Response Format
|
|
173
|
+
|
|
174
|
+
All verification results include:
|
|
175
|
+
|
|
176
|
+
- **Verdict**: Overall assessment (supported/contradicted/mixed/unverifiable)
|
|
177
|
+
- **Confidence**: 0-100% confidence score
|
|
178
|
+
- **Sources**: List of authoritative citations
|
|
179
|
+
- **Stance Analysis**: Per-source support/contradict assessment
|
|
180
|
+
- **Key Findings**: Important facts extracted from sources
|
|
181
|
+
- **Corrections**: When the claim contains inaccuracies
|
|
182
|
+
|
|
183
|
+
## Pricing
|
|
184
|
+
|
|
185
|
+
| Plan | Monthly Credits | Price |
|
|
186
|
+
|------|-----------------|-------|
|
|
187
|
+
| Free | 50 | $0 |
|
|
188
|
+
| Builder | 500 | $20 |
|
|
189
|
+
| Team | 2,000 | $50 |
|
|
190
|
+
| Enterprise | Custom | Contact us |
|
|
191
|
+
|
|
192
|
+
## Support
|
|
193
|
+
|
|
194
|
+
- Documentation: [docs.webcite.co](https://docs.webcite.co)
|
|
195
|
+
- Issues: [github.com/webcite/mcp-server/issues](https://github.com/webcite/mcp-server/issues)
|
|
196
|
+
- Email: support@webcite.co
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
MIT
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebCite API Client
|
|
3
|
+
* Handles all communication with the WebCite backend API
|
|
4
|
+
*/
|
|
5
|
+
export interface VerifyClaimOptions {
|
|
6
|
+
claim: string;
|
|
7
|
+
include_stance?: boolean;
|
|
8
|
+
include_verdict?: boolean;
|
|
9
|
+
use_claim_decomposition?: boolean;
|
|
10
|
+
thread_id?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SearchSourcesOptions {
|
|
13
|
+
query: string;
|
|
14
|
+
limit?: number;
|
|
15
|
+
thread_id?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ListCitationsOptions {
|
|
18
|
+
page?: number;
|
|
19
|
+
limit?: number;
|
|
20
|
+
thread_id?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface Citation {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
url: string;
|
|
26
|
+
snippet: string;
|
|
27
|
+
author?: string;
|
|
28
|
+
status?: string;
|
|
29
|
+
credibility_score?: number;
|
|
30
|
+
rank?: number;
|
|
31
|
+
stance?: 'supports' | 'contradicts' | 'partially_supports' | 'neutral' | 'irrelevant';
|
|
32
|
+
stance_confidence?: number;
|
|
33
|
+
stance_explanation?: string;
|
|
34
|
+
ranking_factors?: {
|
|
35
|
+
source_authority: number;
|
|
36
|
+
content_relevance: number;
|
|
37
|
+
recency: number;
|
|
38
|
+
};
|
|
39
|
+
source_metadata?: {
|
|
40
|
+
domain: string;
|
|
41
|
+
domain_category: string;
|
|
42
|
+
is_primary_source: boolean;
|
|
43
|
+
is_fact_check_site: boolean;
|
|
44
|
+
};
|
|
45
|
+
publication_year?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface Verdict {
|
|
48
|
+
claim: string;
|
|
49
|
+
result: 'supported' | 'partially_supported' | 'contradicted' | 'mixed' | 'unverifiable';
|
|
50
|
+
confidence: number;
|
|
51
|
+
summary: string;
|
|
52
|
+
stance_breakdown: {
|
|
53
|
+
supports: number;
|
|
54
|
+
partially_supports: number;
|
|
55
|
+
contradicts: number;
|
|
56
|
+
neutral: number;
|
|
57
|
+
};
|
|
58
|
+
key_findings?: Array<{
|
|
59
|
+
finding: string;
|
|
60
|
+
citation_ids: string[];
|
|
61
|
+
confidence: number;
|
|
62
|
+
}>;
|
|
63
|
+
corrections?: Array<{
|
|
64
|
+
claimed: string;
|
|
65
|
+
actual: string;
|
|
66
|
+
citation_ids: string[];
|
|
67
|
+
}>;
|
|
68
|
+
unverified_claims?: string[];
|
|
69
|
+
}
|
|
70
|
+
export interface ClaimGroup {
|
|
71
|
+
claim_id: string;
|
|
72
|
+
claim_index: number;
|
|
73
|
+
claim: string;
|
|
74
|
+
stance_summary: 'supported' | 'contradicted' | 'mixed' | 'unverifiable';
|
|
75
|
+
citation_count: number;
|
|
76
|
+
citations: Citation[];
|
|
77
|
+
verdict?: Verdict;
|
|
78
|
+
}
|
|
79
|
+
export interface VerifyClaimResponse {
|
|
80
|
+
claim_groups: ClaimGroup[];
|
|
81
|
+
totalResults: number;
|
|
82
|
+
thread_id: string;
|
|
83
|
+
citations?: Citation[];
|
|
84
|
+
verdict?: Verdict;
|
|
85
|
+
generated_prompts?: string[];
|
|
86
|
+
credit_usage?: {
|
|
87
|
+
credits_used: number;
|
|
88
|
+
credits_remaining: number;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export interface CitationRecord {
|
|
92
|
+
id: string;
|
|
93
|
+
thread_id: string;
|
|
94
|
+
prompt: string;
|
|
95
|
+
citation?: string | Citation[];
|
|
96
|
+
created_at?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface ListCitationsResponse {
|
|
99
|
+
data: CitationRecord[];
|
|
100
|
+
pagination: {
|
|
101
|
+
total: number;
|
|
102
|
+
page: number;
|
|
103
|
+
limit: number;
|
|
104
|
+
totalPages: number;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export declare class WebCiteApiClient {
|
|
108
|
+
private readonly baseUrl;
|
|
109
|
+
private readonly apiKey;
|
|
110
|
+
constructor(apiKey: string, baseUrl?: string);
|
|
111
|
+
private request;
|
|
112
|
+
/**
|
|
113
|
+
* Verify a factual claim against authoritative sources
|
|
114
|
+
* Full verification includes: search, stance analysis, and verdict
|
|
115
|
+
*/
|
|
116
|
+
verifyClaim(options: VerifyClaimOptions): Promise<VerifyClaimResponse>;
|
|
117
|
+
/**
|
|
118
|
+
* Search for sources related to a claim (citation only, no analysis)
|
|
119
|
+
* Cheaper option - just returns raw citations without stance/verdict
|
|
120
|
+
*/
|
|
121
|
+
searchSources(options: SearchSourcesOptions): Promise<VerifyClaimResponse>;
|
|
122
|
+
/**
|
|
123
|
+
* List all citations for the authenticated user
|
|
124
|
+
*/
|
|
125
|
+
listCitations(options?: ListCitationsOptions): Promise<ListCitationsResponse>;
|
|
126
|
+
/**
|
|
127
|
+
* Get a specific citation by ID
|
|
128
|
+
*/
|
|
129
|
+
getCitation(citationId: string): Promise<{
|
|
130
|
+
data: {
|
|
131
|
+
prompt: string;
|
|
132
|
+
citation: string | Citation[];
|
|
133
|
+
};
|
|
134
|
+
}>;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW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C;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,MAAiC;YAKxD,OAAO;IAuBrB;;;OAGG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAe5E;;;OAGG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAchF;;OAEG;IACG,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAcvF;;OAEG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;SAAE,CAAA;KAAE,CAAC;CAK5G"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* WebCite API Client
|
|
4
|
+
* Handles all communication with the WebCite backend API
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.WebCiteApiClient = void 0;
|
|
8
|
+
class WebCiteApiClient {
|
|
9
|
+
baseUrl;
|
|
10
|
+
apiKey;
|
|
11
|
+
constructor(apiKey, baseUrl = 'https://api.webcite.co') {
|
|
12
|
+
this.apiKey = apiKey;
|
|
13
|
+
this.baseUrl = baseUrl.replace(/\/$/, ''); // Remove trailing slash
|
|
14
|
+
}
|
|
15
|
+
async request(endpoint, options = {}) {
|
|
16
|
+
const url = `${this.baseUrl}${endpoint}`;
|
|
17
|
+
const response = await fetch(url, {
|
|
18
|
+
...options,
|
|
19
|
+
headers: {
|
|
20
|
+
'Content-Type': 'application/json',
|
|
21
|
+
'X-API-Key': this.apiKey,
|
|
22
|
+
...options.headers,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
const errorBody = await response.text();
|
|
27
|
+
throw new Error(`WebCite API error (${response.status}): ${errorBody}`);
|
|
28
|
+
}
|
|
29
|
+
return response.json();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Verify a factual claim against authoritative sources
|
|
33
|
+
* Full verification includes: search, stance analysis, and verdict
|
|
34
|
+
*/
|
|
35
|
+
async verifyClaim(options) {
|
|
36
|
+
return this.request('/playground/chat', {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
body: JSON.stringify({
|
|
39
|
+
prompt: options.claim,
|
|
40
|
+
thread_id: options.thread_id,
|
|
41
|
+
useCitationAnalyse: true,
|
|
42
|
+
useEnhancedAnalysis: true,
|
|
43
|
+
useStanceAnalysis: options.include_stance !== false,
|
|
44
|
+
useVerdict: options.include_verdict !== false,
|
|
45
|
+
useClaimDecomposition: options.use_claim_decomposition ?? false,
|
|
46
|
+
}),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Search for sources related to a claim (citation only, no analysis)
|
|
51
|
+
* Cheaper option - just returns raw citations without stance/verdict
|
|
52
|
+
*/
|
|
53
|
+
async searchSources(options) {
|
|
54
|
+
return this.request('/playground/chat', {
|
|
55
|
+
method: 'POST',
|
|
56
|
+
body: JSON.stringify({
|
|
57
|
+
prompt: options.query,
|
|
58
|
+
thread_id: options.thread_id,
|
|
59
|
+
useCitationAnalyse: false, // Disable all analysis for raw search
|
|
60
|
+
useEnhancedAnalysis: false,
|
|
61
|
+
useStanceAnalysis: false,
|
|
62
|
+
useVerdict: false,
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* List all citations for the authenticated user
|
|
68
|
+
*/
|
|
69
|
+
async listCitations(options = {}) {
|
|
70
|
+
const params = new URLSearchParams();
|
|
71
|
+
if (options.page)
|
|
72
|
+
params.append('page', String(options.page));
|
|
73
|
+
if (options.limit)
|
|
74
|
+
params.append('limit', String(options.limit));
|
|
75
|
+
if (options.thread_id)
|
|
76
|
+
params.append('thread_id', options.thread_id);
|
|
77
|
+
const queryString = params.toString();
|
|
78
|
+
const endpoint = `/playground/citations${queryString ? `?${queryString}` : ''}`;
|
|
79
|
+
return this.request(endpoint, {
|
|
80
|
+
method: 'GET',
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get a specific citation by ID
|
|
85
|
+
*/
|
|
86
|
+
async getCitation(citationId) {
|
|
87
|
+
return this.request(`/playground/citation?id=${encodeURIComponent(citationId)}`, {
|
|
88
|
+
method: 'GET',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.WebCiteApiClient = WebCiteApiClient;
|
|
93
|
+
//# sourceMappingURL=api-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiHH,MAAa,gBAAgB;IACV,OAAO,CAAS;IAChB,MAAM,CAAS;IAEhC,YAAY,MAAc,EAAE,UAAkB,wBAAwB;QACpE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAA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AA9FD,4CA8FC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* WebCite MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Provides fact verification and citation tools for Claude.
|
|
6
|
+
*
|
|
7
|
+
* Tools:
|
|
8
|
+
* - verify_claim: Full verification with stance analysis and verdict
|
|
9
|
+
* - search_sources: Quick citation search without analysis
|
|
10
|
+
* - list_citations: List past verification results
|
|
11
|
+
* - get_citation: Get details of a specific verification
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;GAUG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* WebCite MCP Server
|
|
5
|
+
*
|
|
6
|
+
* Provides fact verification and citation tools for Claude.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* - verify_claim: Full verification with stance analysis and verdict
|
|
10
|
+
* - search_sources: Quick citation search without analysis
|
|
11
|
+
* - list_citations: List past verification results
|
|
12
|
+
* - get_citation: Get details of a specific verification
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
16
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
17
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
18
|
+
const api_client_js_1 = require("./api-client.js");
|
|
19
|
+
// Get API key from environment
|
|
20
|
+
const API_KEY = process.env.WEBCITE_API_KEY;
|
|
21
|
+
const BASE_URL = process.env.WEBCITE_API_URL || 'https://api.webcite.co';
|
|
22
|
+
if (!API_KEY) {
|
|
23
|
+
console.error('Error: WEBCITE_API_KEY environment variable is required');
|
|
24
|
+
console.error('Get your API key at https://webcite.co/api-keys');
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
const client = new api_client_js_1.WebCiteApiClient(API_KEY, BASE_URL);
|
|
28
|
+
// Define tools
|
|
29
|
+
const TOOLS = [
|
|
30
|
+
{
|
|
31
|
+
name: 'verify_claim',
|
|
32
|
+
description: `Verify a factual claim against authoritative sources. Returns sources with stance analysis (supports/contradicts/neutral) and an overall verdict.
|
|
33
|
+
|
|
34
|
+
Use this when you need to:
|
|
35
|
+
- Fact-check a specific claim
|
|
36
|
+
- Find sources that support or contradict a statement
|
|
37
|
+
- Get a confidence score for a claim's accuracy
|
|
38
|
+
|
|
39
|
+
Credits: 2-4 depending on options (search: 2, +stance: 1, +verdict: 1)`,
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
claim: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'The factual claim to verify (e.g., "The Eiffel Tower is 330 meters tall")',
|
|
46
|
+
},
|
|
47
|
+
include_stance: {
|
|
48
|
+
type: 'boolean',
|
|
49
|
+
description: 'Include stance analysis (supports/contradicts) for each source. Adds 1 credit. Default: true',
|
|
50
|
+
default: true,
|
|
51
|
+
},
|
|
52
|
+
include_verdict: {
|
|
53
|
+
type: 'boolean',
|
|
54
|
+
description: 'Generate an overall verdict with confidence score. Adds 1 credit. Default: true',
|
|
55
|
+
default: true,
|
|
56
|
+
},
|
|
57
|
+
decompose_claim: {
|
|
58
|
+
type: 'boolean',
|
|
59
|
+
description: 'Break complex claims into sub-claims and verify each independently. Useful for multi-part claims.',
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
required: ['claim'],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'search_sources',
|
|
68
|
+
description: `Search for authoritative sources related to a query. Returns raw citations without stance analysis or verdict.
|
|
69
|
+
|
|
70
|
+
Use this when you need to:
|
|
71
|
+
- Find sources on a topic quickly
|
|
72
|
+
- Get raw search results for further analysis
|
|
73
|
+
- Save credits by skipping analysis
|
|
74
|
+
|
|
75
|
+
Credits: 2 (search only)`,
|
|
76
|
+
inputSchema: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
properties: {
|
|
79
|
+
query: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
description: 'Search query or claim to find sources for',
|
|
82
|
+
},
|
|
83
|
+
limit: {
|
|
84
|
+
type: 'number',
|
|
85
|
+
description: 'Maximum number of sources to return (1-20)',
|
|
86
|
+
default: 10,
|
|
87
|
+
minimum: 1,
|
|
88
|
+
maximum: 20,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
required: ['query'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'list_citations',
|
|
96
|
+
description: `List your past verification results. Useful for reviewing previous fact-checks or continuing a research session.
|
|
97
|
+
|
|
98
|
+
Credits: 0 (free)`,
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: 'object',
|
|
101
|
+
properties: {
|
|
102
|
+
page: {
|
|
103
|
+
type: 'number',
|
|
104
|
+
description: 'Page number (starts at 1)',
|
|
105
|
+
default: 1,
|
|
106
|
+
minimum: 1,
|
|
107
|
+
},
|
|
108
|
+
limit: {
|
|
109
|
+
type: 'number',
|
|
110
|
+
description: 'Results per page (max 50)',
|
|
111
|
+
default: 10,
|
|
112
|
+
minimum: 1,
|
|
113
|
+
maximum: 50,
|
|
114
|
+
},
|
|
115
|
+
thread_id: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
description: 'Filter by thread ID to get citations from a specific session',
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'get_citation',
|
|
124
|
+
description: `Get the full details of a specific past verification by its ID.
|
|
125
|
+
|
|
126
|
+
Credits: 0 (free)`,
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: {
|
|
130
|
+
citation_id: {
|
|
131
|
+
type: 'string',
|
|
132
|
+
description: 'The citation ID to retrieve',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
required: ['citation_id'],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
];
|
|
139
|
+
/**
|
|
140
|
+
* Format a citation for display
|
|
141
|
+
*/
|
|
142
|
+
function formatCitation(citation, index) {
|
|
143
|
+
const parts = [];
|
|
144
|
+
parts.push(`${index + 1}. **${citation.title || 'Untitled'}**`);
|
|
145
|
+
parts.push(` URL: ${citation.url}`);
|
|
146
|
+
if (citation.stance) {
|
|
147
|
+
const stanceEmoji = {
|
|
148
|
+
supports: '✓',
|
|
149
|
+
partially_supports: '~',
|
|
150
|
+
contradicts: '✗',
|
|
151
|
+
neutral: '○',
|
|
152
|
+
irrelevant: '—',
|
|
153
|
+
}[citation.stance] || '?';
|
|
154
|
+
parts.push(` Stance: ${stanceEmoji} ${citation.stance}${citation.stance_confidence ? ` (${citation.stance_confidence}% confidence)` : ''}`);
|
|
155
|
+
}
|
|
156
|
+
if (citation.credibility_score) {
|
|
157
|
+
parts.push(` Credibility: ${citation.credibility_score}/100`);
|
|
158
|
+
}
|
|
159
|
+
if (citation.snippet) {
|
|
160
|
+
const truncatedSnippet = citation.snippet.length > 200
|
|
161
|
+
? citation.snippet.substring(0, 200) + '...'
|
|
162
|
+
: citation.snippet;
|
|
163
|
+
parts.push(` Snippet: "${truncatedSnippet}"`);
|
|
164
|
+
}
|
|
165
|
+
if (citation.stance_explanation) {
|
|
166
|
+
parts.push(` Analysis: ${citation.stance_explanation}`);
|
|
167
|
+
}
|
|
168
|
+
return parts.join('\n');
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Format a verdict for display
|
|
172
|
+
*/
|
|
173
|
+
function formatVerdict(verdict) {
|
|
174
|
+
const parts = [];
|
|
175
|
+
const resultEmoji = {
|
|
176
|
+
supported: '✓',
|
|
177
|
+
partially_supported: '~',
|
|
178
|
+
contradicted: '✗',
|
|
179
|
+
mixed: '⚡',
|
|
180
|
+
unverifiable: '?',
|
|
181
|
+
}[verdict.result] || '?';
|
|
182
|
+
parts.push(`## Verdict: ${resultEmoji} ${verdict.result.toUpperCase()}`);
|
|
183
|
+
parts.push(`**Confidence:** ${verdict.confidence}%`);
|
|
184
|
+
parts.push(`**Summary:** ${verdict.summary}`);
|
|
185
|
+
if (verdict.stance_breakdown) {
|
|
186
|
+
const sb = verdict.stance_breakdown;
|
|
187
|
+
parts.push(`\n**Source Breakdown:**`);
|
|
188
|
+
parts.push(`- Supporting: ${sb.supports}`);
|
|
189
|
+
parts.push(`- Partially supporting: ${sb.partially_supports}`);
|
|
190
|
+
parts.push(`- Contradicting: ${sb.contradicts}`);
|
|
191
|
+
parts.push(`- Neutral: ${sb.neutral}`);
|
|
192
|
+
}
|
|
193
|
+
if (verdict.key_findings && verdict.key_findings.length > 0) {
|
|
194
|
+
parts.push(`\n**Key Findings:**`);
|
|
195
|
+
verdict.key_findings.forEach((finding, i) => {
|
|
196
|
+
parts.push(`${i + 1}. ${finding.finding} (${finding.confidence}% confidence)`);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
if (verdict.corrections && verdict.corrections.length > 0) {
|
|
200
|
+
parts.push(`\n**Corrections:**`);
|
|
201
|
+
verdict.corrections.forEach((correction, i) => {
|
|
202
|
+
parts.push(`${i + 1}. Claimed: "${correction.claimed}" → Actual: "${correction.actual}"`);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
if (verdict.unverified_claims && verdict.unverified_claims.length > 0) {
|
|
206
|
+
parts.push(`\n**Unverified Parts:**`);
|
|
207
|
+
verdict.unverified_claims.forEach((claim, i) => {
|
|
208
|
+
parts.push(`${i + 1}. ${claim}`);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
return parts.join('\n');
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Format a claim group for display
|
|
215
|
+
*/
|
|
216
|
+
function formatClaimGroup(group) {
|
|
217
|
+
const parts = [];
|
|
218
|
+
parts.push(`### Claim ${group.claim_index}: "${group.claim}"`);
|
|
219
|
+
parts.push(`Status: ${group.stance_summary} | Sources: ${group.citation_count}`);
|
|
220
|
+
if (group.citations && group.citations.length > 0) {
|
|
221
|
+
parts.push('\n**Sources:**');
|
|
222
|
+
group.citations.slice(0, 5).forEach((citation, i) => {
|
|
223
|
+
parts.push(formatCitation(citation, i));
|
|
224
|
+
});
|
|
225
|
+
if (group.citations.length > 5) {
|
|
226
|
+
parts.push(`\n... and ${group.citations.length - 5} more sources`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (group.verdict) {
|
|
230
|
+
parts.push('\n' + formatVerdict(group.verdict));
|
|
231
|
+
}
|
|
232
|
+
return parts.join('\n');
|
|
233
|
+
}
|
|
234
|
+
// Create and configure the server
|
|
235
|
+
const server = new index_js_1.Server({
|
|
236
|
+
name: 'webcite',
|
|
237
|
+
version: '1.0.0',
|
|
238
|
+
}, {
|
|
239
|
+
capabilities: {
|
|
240
|
+
tools: {},
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
// Handle tool listing
|
|
244
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
245
|
+
tools: TOOLS,
|
|
246
|
+
}));
|
|
247
|
+
// Handle tool calls
|
|
248
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
249
|
+
const { name, arguments: args } = request.params;
|
|
250
|
+
try {
|
|
251
|
+
switch (name) {
|
|
252
|
+
case 'verify_claim': {
|
|
253
|
+
const claim = args?.claim;
|
|
254
|
+
const includeStance = args?.include_stance !== false;
|
|
255
|
+
const includeVerdict = args?.include_verdict !== false;
|
|
256
|
+
const decomposeClaim = args?.decompose_claim === true;
|
|
257
|
+
if (!claim) {
|
|
258
|
+
return {
|
|
259
|
+
content: [{ type: 'text', text: 'Error: claim is required' }],
|
|
260
|
+
isError: true,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
const result = await client.verifyClaim({
|
|
264
|
+
claim,
|
|
265
|
+
include_stance: includeStance,
|
|
266
|
+
include_verdict: includeVerdict,
|
|
267
|
+
use_claim_decomposition: decomposeClaim,
|
|
268
|
+
});
|
|
269
|
+
// Format the response
|
|
270
|
+
const parts = [];
|
|
271
|
+
parts.push(`# Fact Check: "${claim}"\n`);
|
|
272
|
+
// Show claim groups (unified structure)
|
|
273
|
+
if (result.claim_groups && result.claim_groups.length > 0) {
|
|
274
|
+
if (result.claim_groups.length === 1) {
|
|
275
|
+
// Single claim - show directly
|
|
276
|
+
const group = result.claim_groups[0];
|
|
277
|
+
if (group.verdict) {
|
|
278
|
+
parts.push(formatVerdict(group.verdict));
|
|
279
|
+
parts.push('');
|
|
280
|
+
}
|
|
281
|
+
if (group.citations && group.citations.length > 0) {
|
|
282
|
+
parts.push('## Sources\n');
|
|
283
|
+
group.citations.forEach((citation, i) => {
|
|
284
|
+
parts.push(formatCitation(citation, i));
|
|
285
|
+
parts.push('');
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
// Multiple claims - show each group
|
|
291
|
+
parts.push(`Found ${result.claim_groups.length} sub-claims:\n`);
|
|
292
|
+
result.claim_groups.forEach(group => {
|
|
293
|
+
parts.push(formatClaimGroup(group));
|
|
294
|
+
parts.push('\n---\n');
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
else if (result.citations && result.citations.length > 0) {
|
|
299
|
+
// Legacy format - direct citations
|
|
300
|
+
if (result.verdict) {
|
|
301
|
+
parts.push(formatVerdict(result.verdict));
|
|
302
|
+
parts.push('');
|
|
303
|
+
}
|
|
304
|
+
parts.push('## Sources\n');
|
|
305
|
+
result.citations.forEach((citation, i) => {
|
|
306
|
+
parts.push(formatCitation(citation, i));
|
|
307
|
+
parts.push('');
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
parts.push('No sources found for this claim.');
|
|
312
|
+
}
|
|
313
|
+
// Add credit usage info
|
|
314
|
+
if (result.credit_usage) {
|
|
315
|
+
parts.push(`\n---\nCredits used: ${result.credit_usage.credits_used} | Remaining: ${result.credit_usage.credits_remaining}`);
|
|
316
|
+
}
|
|
317
|
+
return {
|
|
318
|
+
content: [{ type: 'text', text: parts.join('\n') }],
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
case 'search_sources': {
|
|
322
|
+
const query = args?.query;
|
|
323
|
+
const limit = Math.min(Math.max(args?.limit || 10, 1), 20);
|
|
324
|
+
if (!query) {
|
|
325
|
+
return {
|
|
326
|
+
content: [{ type: 'text', text: 'Error: query is required' }],
|
|
327
|
+
isError: true,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
const result = await client.searchSources({ query, limit });
|
|
331
|
+
// Format the response
|
|
332
|
+
const parts = [];
|
|
333
|
+
parts.push(`# Search Results: "${query}"\n`);
|
|
334
|
+
const citations = result.claim_groups?.[0]?.citations || result.citations || [];
|
|
335
|
+
if (citations.length > 0) {
|
|
336
|
+
parts.push(`Found ${citations.length} sources:\n`);
|
|
337
|
+
citations.slice(0, limit).forEach((citation, i) => {
|
|
338
|
+
parts.push(formatCitation(citation, i));
|
|
339
|
+
parts.push('');
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
else {
|
|
343
|
+
parts.push('No sources found for this query.');
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
content: [{ type: 'text', text: parts.join('\n') }],
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
case 'list_citations': {
|
|
350
|
+
const page = Math.max(args?.page || 1, 1);
|
|
351
|
+
const limit = Math.min(Math.max(args?.limit || 10, 1), 50);
|
|
352
|
+
const threadId = args?.thread_id;
|
|
353
|
+
const result = await client.listCitations({ page, limit, thread_id: threadId });
|
|
354
|
+
// Format the response
|
|
355
|
+
const parts = [];
|
|
356
|
+
parts.push(`# Your Verification History\n`);
|
|
357
|
+
parts.push(`Page ${result.pagination.page} of ${result.pagination.totalPages} (${result.pagination.total} total)\n`);
|
|
358
|
+
if (result.data.length > 0) {
|
|
359
|
+
result.data.forEach((record, i) => {
|
|
360
|
+
parts.push(`${i + 1}. **${record.prompt}**`);
|
|
361
|
+
parts.push(` ID: ${record.id}`);
|
|
362
|
+
if (record.created_at) {
|
|
363
|
+
parts.push(` Date: ${new Date(record.created_at).toLocaleString()}`);
|
|
364
|
+
}
|
|
365
|
+
parts.push('');
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
parts.push('No verification history found.');
|
|
370
|
+
}
|
|
371
|
+
return {
|
|
372
|
+
content: [{ type: 'text', text: parts.join('\n') }],
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
case 'get_citation': {
|
|
376
|
+
const citationId = args?.citation_id;
|
|
377
|
+
if (!citationId) {
|
|
378
|
+
return {
|
|
379
|
+
content: [{ type: 'text', text: 'Error: citation_id is required' }],
|
|
380
|
+
isError: true,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
const result = await client.getCitation(citationId);
|
|
384
|
+
// Format the response
|
|
385
|
+
const parts = [];
|
|
386
|
+
parts.push(`# Verification Details\n`);
|
|
387
|
+
parts.push(`**Prompt:** ${result.data.prompt}\n`);
|
|
388
|
+
// Parse citations if they're a string
|
|
389
|
+
let citations = [];
|
|
390
|
+
if (typeof result.data.citation === 'string') {
|
|
391
|
+
try {
|
|
392
|
+
citations = JSON.parse(result.data.citation);
|
|
393
|
+
}
|
|
394
|
+
catch {
|
|
395
|
+
citations = [];
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
else if (Array.isArray(result.data.citation)) {
|
|
399
|
+
citations = result.data.citation;
|
|
400
|
+
}
|
|
401
|
+
if (citations.length > 0) {
|
|
402
|
+
parts.push('## Sources\n');
|
|
403
|
+
citations.forEach((citation, i) => {
|
|
404
|
+
parts.push(formatCitation(citation, i));
|
|
405
|
+
parts.push('');
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
return {
|
|
409
|
+
content: [{ type: 'text', text: parts.join('\n') }],
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
default:
|
|
413
|
+
return {
|
|
414
|
+
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
415
|
+
isError: true,
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
catch (error) {
|
|
420
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
421
|
+
return {
|
|
422
|
+
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
423
|
+
isError: true,
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
// Start the server
|
|
428
|
+
async function main() {
|
|
429
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
430
|
+
await server.connect(transport);
|
|
431
|
+
console.error('WebCite MCP Server running');
|
|
432
|
+
}
|
|
433
|
+
main().catch((error) => {
|
|
434
|
+
console.error('Fatal error:', error);
|
|
435
|
+
process.exit(1);
|
|
436
|
+
});
|
|
437
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;;GAUG;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAI4C;AAC5C,mDAAkF;AAElF,+BAA+B;AAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,wBAAwB,CAAC;AAEzE,IAAI,CAAC,OAAO,EAAE,CAAC;IACb,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AC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;YACtD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAC9C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "webcite-mcp-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "WebCite MCP Server for Claude - Fact verification and citation API",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"webcite-mcp": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"test": "node --test",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"mcp",
|
|
19
|
+
"claude",
|
|
20
|
+
"anthropic",
|
|
21
|
+
"fact-check",
|
|
22
|
+
"citation",
|
|
23
|
+
"webcite",
|
|
24
|
+
"verification"
|
|
25
|
+
],
|
|
26
|
+
"author": "WebCite",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^20.0.0",
|
|
33
|
+
"typescript": "^5.0.0"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=18.0.0"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "https://github.com/webcite/webcite-mcp-server"
|
|
45
|
+
}
|
|
46
|
+
}
|