mcpeye 0.1.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.
- checksums.yaml +7 -0
- data/README.md +265 -0
- data/lib/mcpeye/intent.rb +94 -0
- data/lib/mcpeye/redaction.rb +112 -0
- data/lib/mcpeye/request_capability.rb +74 -0
- data/lib/mcpeye/tracker.rb +844 -0
- data/lib/mcpeye/version.rb +5 -0
- data/lib/mcpeye.rb +66 -0
- metadata +55 -0
data/lib/mcpeye.rb
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "mcpeye/version"
|
|
4
|
+
require_relative "mcpeye/intent"
|
|
5
|
+
require_relative "mcpeye/request_capability"
|
|
6
|
+
require_relative "mcpeye/redaction"
|
|
7
|
+
require_relative "mcpeye/tracker"
|
|
8
|
+
|
|
9
|
+
# mcpeye — intent-gap analytics for MCP servers. "See why your agent is failing."
|
|
10
|
+
#
|
|
11
|
+
# This gem instruments a Ruby/Rails MCP server: it injects the optional
|
|
12
|
+
# `mcpeyeIntent` parameter into your tool schemas, captures every tool call
|
|
13
|
+
# (redacting secrets/PII client-side), buffers them, and POSTs the same
|
|
14
|
+
# IngestPayload JSON contract that every mcpeye SDK speaks to your self-hosted
|
|
15
|
+
# mcpeye instance at "#{ingest_url}/ingest".
|
|
16
|
+
module Mcpeye
|
|
17
|
+
# Instrument an MCP server and return a Tracker.
|
|
18
|
+
#
|
|
19
|
+
# tracker = Mcpeye.track(
|
|
20
|
+
# server,
|
|
21
|
+
# "my-project-id",
|
|
22
|
+
# ingest_url: "http://localhost:3001", # or ENV["MCPEYE_INGEST_URL"]
|
|
23
|
+
# ingest_secret: ENV["MCPEYE_INGEST_SECRET"],
|
|
24
|
+
# redact: true,
|
|
25
|
+
# flush_interval: 5, # background flush every 5s (opt-in)
|
|
26
|
+
# identify: -> { { userId: Current.user_id } }, # per-flush identity (opt-in)
|
|
27
|
+
# on_error: ->(e) { Rails.logger.warn(e) } # diagnostics sink (opt-in)
|
|
28
|
+
# )
|
|
29
|
+
#
|
|
30
|
+
# The intent param is injected into discoverable tool schemas and discoverable
|
|
31
|
+
# handlers are wrapped. For servers whose internals can't be introspected, use
|
|
32
|
+
# the returned Tracker's #wrap / #record / #flush directly.
|
|
33
|
+
#
|
|
34
|
+
# When `flush_interval` is set, a background flush thread is started for you.
|
|
35
|
+
# A drain is registered via at_exit, so callers no longer must remember it
|
|
36
|
+
# (the explicit `at_exit { tracker.flush }` still works — it's idempotent).
|
|
37
|
+
# In a forking server (Puma/Unicorn cluster) the thread does not survive fork:
|
|
38
|
+
# call `tracker.start_flush_thread` from `on_worker_boot`. See the README.
|
|
39
|
+
#
|
|
40
|
+
# Returns the Tracker.
|
|
41
|
+
def self.track(server, project_id,
|
|
42
|
+
ingest_url: nil,
|
|
43
|
+
ingest_secret: nil,
|
|
44
|
+
redact: true,
|
|
45
|
+
identity: {},
|
|
46
|
+
identify: nil,
|
|
47
|
+
flush_interval: nil,
|
|
48
|
+
on_error: nil,
|
|
49
|
+
**opts)
|
|
50
|
+
tracker = Tracker.new(
|
|
51
|
+
project_id,
|
|
52
|
+
ingest_url: ingest_url,
|
|
53
|
+
ingest_secret: ingest_secret,
|
|
54
|
+
redact: redact,
|
|
55
|
+
identity: identity,
|
|
56
|
+
identify: identify,
|
|
57
|
+
flush_interval: flush_interval,
|
|
58
|
+
on_error: on_error,
|
|
59
|
+
**opts
|
|
60
|
+
)
|
|
61
|
+
tracker.instrument(server)
|
|
62
|
+
tracker.start_flush_thread
|
|
63
|
+
at_exit { tracker.at_exit_drain }
|
|
64
|
+
tracker
|
|
65
|
+
end
|
|
66
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: mcpeye
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- mcpeye
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-06-21 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: mcpeye captures what your agents try to do through your MCP tools — including
|
|
14
|
+
the asks your tools could NOT fulfill — and ships them to a self-hosted mcpeye instance
|
|
15
|
+
for the Intent Gap Report. This gem instruments a Ruby/Rails MCP server.
|
|
16
|
+
email:
|
|
17
|
+
- saas@healinbox.com
|
|
18
|
+
executables: []
|
|
19
|
+
extensions: []
|
|
20
|
+
extra_rdoc_files: []
|
|
21
|
+
files:
|
|
22
|
+
- README.md
|
|
23
|
+
- lib/mcpeye.rb
|
|
24
|
+
- lib/mcpeye/intent.rb
|
|
25
|
+
- lib/mcpeye/redaction.rb
|
|
26
|
+
- lib/mcpeye/request_capability.rb
|
|
27
|
+
- lib/mcpeye/tracker.rb
|
|
28
|
+
- lib/mcpeye/version.rb
|
|
29
|
+
homepage: https://github.com/mcpeye/mcpeye
|
|
30
|
+
licenses:
|
|
31
|
+
- MIT
|
|
32
|
+
metadata:
|
|
33
|
+
homepage_uri: https://github.com/mcpeye/mcpeye
|
|
34
|
+
source_code_uri: https://github.com/mcpeye/mcpeye
|
|
35
|
+
changelog_uri: https://github.com/mcpeye/mcpeye/releases
|
|
36
|
+
post_install_message:
|
|
37
|
+
rdoc_options: []
|
|
38
|
+
require_paths:
|
|
39
|
+
- lib
|
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
41
|
+
requirements:
|
|
42
|
+
- - ">="
|
|
43
|
+
- !ruby/object:Gem::Version
|
|
44
|
+
version: 3.0.0
|
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
|
+
requirements:
|
|
47
|
+
- - ">="
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: '0'
|
|
50
|
+
requirements: []
|
|
51
|
+
rubygems_version: 3.4.10
|
|
52
|
+
signing_key:
|
|
53
|
+
specification_version: 4
|
|
54
|
+
summary: Product analytics for Ruby/Rails MCP servers.
|
|
55
|
+
test_files: []
|