zotero-mcp 1.3.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.
data/lib/zotero/mcp.rb ADDED
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ # 1. Standard library
4
+ require "json"
5
+ require "net/http"
6
+ require "openssl"
7
+ require "securerandom"
8
+ require "uri"
9
+
10
+ # 2. Third-party gems
11
+ require "mcp"
12
+ require "mcp/server/transports/stdio_transport"
13
+
14
+ # 3. This library
15
+ require_relative "mcp/version"
16
+ require_relative "mcp/errors"
17
+ require_relative "mcp/config"
18
+ require_relative "mcp/helpers"
19
+ require_relative "mcp/read_api"
20
+ require_relative "mcp/write_api"
21
+ require_relative "mcp/response_handling"
22
+ require_relative "mcp/client"
23
+ require_relative "mcp/formatting"
24
+ require_relative "mcp/fulltext"
25
+ require_relative "mcp/tools/search_items"
26
+ require_relative "mcp/tools/get_item"
27
+ require_relative "mcp/tools/list_collections"
28
+ require_relative "mcp/tools/get_collection_items"
29
+ require_relative "mcp/tools/list_tags"
30
+ require_relative "mcp/tools/get_item_fulltext"
31
+ require_relative "mcp/tools/generate_bibliography"
32
+ require_relative "mcp/tools/get_item_template"
33
+ require_relative "mcp/tools/create_item"
34
+ require_relative "mcp/tools/create_note"
35
+ require_relative "mcp/tools/update_item"
36
+ require_relative "mcp/tools/delete_item"
37
+ require_relative "mcp/tools/add_to_collection"
38
+ require_relative "mcp/tools/create_collection"
39
+
40
+ # Zotero MCP server: exposes the Zotero Web API v3 (and, read-only, the Zotero
41
+ # desktop local API) as MCP tools for Claude Code and other MCP clients.
42
+ #
43
+ # Configuration comes from the environment:
44
+ # ZOTERO_API_KEY key from https://www.zotero.org/settings/keys
45
+ # ZOTERO_LIBRARY_ID numeric user/group id (auto-resolved from the key)
46
+ # ZOTERO_LIBRARY_TYPE "user" (default) or "group"
47
+ # ZOTERO_LOCAL "true" to read the local desktop app (read-only)
48
+ module Zotero
49
+ module MCP
50
+ TOOLS = [
51
+ SearchItems, GetItem, ListCollections, GetCollectionItems,
52
+ ListTags, GetItemFulltext, GenerateBibliography, GetItemTemplate,
53
+ CreateItem, CreateNote, UpdateItem, DeleteItem, AddToCollection,
54
+ CreateCollection
55
+ ].freeze
56
+
57
+ def self.build_server
58
+ ::MCP::Server.new(name: "zotero-mcp", version: VERSION,
59
+ tools: TOOLS)
60
+ end
61
+
62
+ # Serve on stdin/stdout until the client closes the stream.
63
+ def self.run
64
+ ::MCP::Server::Transports::StdioTransport.new(build_server).open
65
+ end
66
+ end
67
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zotero-mcp
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Stephane D'Alu
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: mcp
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.7'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.7'
26
+ description: |
27
+ A Model Context Protocol server that lets Claude Code and other MCP
28
+ clients search, read, cite and edit a Zotero library through the
29
+ Zotero Web API v3, or read it from the Zotero desktop app.
30
+ email:
31
+ - stephane.dalu@gmail.com
32
+ executables:
33
+ - zotero-mcp
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - DESIGN.md
38
+ - LICENSE
39
+ - README.md
40
+ - exe/zotero-mcp
41
+ - lib/zotero/mcp.rb
42
+ - lib/zotero/mcp/client.rb
43
+ - lib/zotero/mcp/config.rb
44
+ - lib/zotero/mcp/errors.rb
45
+ - lib/zotero/mcp/formatting.rb
46
+ - lib/zotero/mcp/fulltext.rb
47
+ - lib/zotero/mcp/helpers.rb
48
+ - lib/zotero/mcp/read_api.rb
49
+ - lib/zotero/mcp/response_handling.rb
50
+ - lib/zotero/mcp/tools/add_to_collection.rb
51
+ - lib/zotero/mcp/tools/create_collection.rb
52
+ - lib/zotero/mcp/tools/create_item.rb
53
+ - lib/zotero/mcp/tools/create_note.rb
54
+ - lib/zotero/mcp/tools/delete_item.rb
55
+ - lib/zotero/mcp/tools/generate_bibliography.rb
56
+ - lib/zotero/mcp/tools/get_collection_items.rb
57
+ - lib/zotero/mcp/tools/get_item.rb
58
+ - lib/zotero/mcp/tools/get_item_fulltext.rb
59
+ - lib/zotero/mcp/tools/get_item_template.rb
60
+ - lib/zotero/mcp/tools/list_collections.rb
61
+ - lib/zotero/mcp/tools/list_tags.rb
62
+ - lib/zotero/mcp/tools/search_items.rb
63
+ - lib/zotero/mcp/tools/update_item.rb
64
+ - lib/zotero/mcp/version.rb
65
+ - lib/zotero/mcp/write_api.rb
66
+ homepage: https://github.com/sdalu/zotero-mcp
67
+ licenses:
68
+ - MIT
69
+ metadata:
70
+ rubygems_mfa_required: 'true'
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '3.3'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubygems_version: 4.0.16
86
+ specification_version: 4
87
+ summary: MCP server for the Zotero Web API and the local Zotero app
88
+ test_files: []